[drakma-devel] Lenient read-line*
Ralf Mattes
rm at seid-online.de
Thu Apr 26 14:44:20 UTC 2007
On Thu, 2007-04-26 at 16:24 +0200, Edi Weitz wrote:
> On Thu, 26 Apr 2007 15:16:18 +0100, Sean <rosssd at gmail.com> wrote:
>
> > I've attached a small patch which makes chunga:read-line* a little
> > more lenient with regards to line endings.
> >
> > Currently (drakma:http-request "http://news.ycombinator.com") fails
> > with an EOF since the arc server doesn't respond with CRLF but only
> > uses plain LF.
>
> So much for Arc...
Sean, i hope you filed a bug against arc - this isn't valid HTTP any
more.
> > The attached patch works around this by assuming that when a
> > LineFeed is encountered it also designates the end of a line,
> > although it is quite possibly the wrong thing.
>
> Thanks, but I wouldn't want to accept that in this form. I think this
> liberal behaviour should be controlled by a user-visible variable and
> the default should be to stick to the RFC.
Yes, please. I'd like to know when i get invalid responses. And once you
start accepting stray LF you might want to accept stray CR as well - the
road to insanity ;-) I vaguely recall sever performance problems in the
early days of Java exactly _because_ their network stack tried some
clever heuristics to catch these kinds of errors.
Cheers Ralf Mattes
P.S: Once again, thank you so much Edi. I'm just testing some custom
Apache modules with Drakma. It's such a pleasure to be able to create
requests from the repl.
> Also, when sending patches, please adhere to the coding style of the
> rest of the code:
>
> http://weitz.de/patches.html
>
> Thanks,
> Edi.
> _______________________________________________
> drakma-devel mailing list
> drakma-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
More information about the Drakma-devel
mailing list