[drakma-devel] Lenient read-line*

Sean rosssd at gmail.com
Mon Apr 30 12:47:07 UTC 2007


On Mon, 2007-04-30 at 11:41 +0000, rm at tuxteam.de wrote: 
> Hmm - IIRC that was causing the problems in Java way back ... imagine
> the sequence "blah blah<cr>" (some network delay "<lf>blub more bah".
> And  then there is "<cr><cr><lf>" (which i've seen at least once!). Is
> this one or two or even three newlines. Iff your answer is > 1 than you
> might start reading header lines as content ....

It would be 2 here, and would quite possibly leave headers unconsumed,
which is in error. The current behaviour is definitely 
preferred for this case (signalling an error) but my feeling is that 
this behaviour, while quite acceptable in this example, is not 
the best for all cases (news.ycombinator.com for example). 

In the same vein the approach I've suggested is definitely not 
the best for all cases, merely a method to workaround 
servers that do not honour RFC 2616[1]. 

Cheers,
Sean.


[1] Granted this is done by ascribing semantics to single CR's and LF's
    in an essentially ad hoc manner.

-- 
...Please don't assume Lisp is only useful for Animation and Graphics,
AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor
applications, Expert Systems, Finance, Intelligent Agents, Knowledge
Management, Mechanical CAD, Modeling and Simulation, Natural Language,
Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web
Authoring just because these are the only things they happened to list.

Kent Pitman.






More information about the Drakma-devel mailing list