[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: do and read-line in MrEd.



Eli Barzilay <eli@barzilay.org> writes:

> On Jul  2, Jordan Katz wrote:
> >    (read-line sin)
> >    (read-line sin)  ;; once more for the blank line
> > ...
> > 
> > I cannot figure out where the preceding empty lines come from, or how
> > to fix it.  Can someone please advise?
> 
> You're sing Gnus, so I guess chances are high that you're on Unix...
> read-line tries to read a Unix-line, terminated by a LF, but HTTP uses
> CR-LF for line separators.  Use (read-line sin 'any) and it will
> probably work fine.  (BTW, the contents can have any kind of line
> terminators.)

If I change all the calls to (read-line sin 'any) I get the following
output:

  "Last-Modified: Fri, 18 May 2001 22:02:12 GMT"
  "ETag: \"12881c-3b-3b059be4\""
  "Accept-Ranges: bytes"
  "Content-Length: 59"
  "Connection: close"
  "Content-Type: text/html"
  ""
  "<pre>"
  "underlevel.net"
  "=============="
  ""
  "Free the text."
  "</pre>"

Which essentially proves my entire code isn't doing even remotely what
I think it's doing.  After the first do, all the lines upto and
including "Content-Type: text/html" were supposed to have been read,
so I don't see how all the junk before that would be printed in the
*second* do.  I have no idea what's going on here; any clues?

Thanks a lot,
-- 
Jordan Katz <katz@underlevel.net>  |  Mind the gap