Sam Steingold wrote:
>> (setq s (socket-connect 80 "www.podval.org" :buffered nil))
>#<IO UNBUFFERED SOCKET-STREAM CHARACTER http://www.podval.org:80>
>> (format s "GET / HTTP/1.0~2%")
Correct me if I'm wrong, but I believe HTTP still mandates CRLF termination in the header. Your code makes no visible provision for that (except for being run within MS-w2k, which may make clisp use that as the default line terminator for all file streams and sockets?).
I've seen web-servers reject HTTP headers using only UNIX-style LF termination (i.e. \n without \r\n).
Therefore, I recommend using :encoding ... :line-terminator :DOS for sending out MIME headers (with HTTP, SMTP and other protocols).
>"Server: Apache/2.0.54 (Fedora)"
Of course, Apache is liberal in what it accepts, and so does not insist on CRLF terminated lines.
Yet even Apache exhibits different response behaviour depending on whether CRLF is supplied or not! (Try an interactive session and observe how fast Apache responds to malformed requests).
Get latest updates about Open Source Projects, Conferences and News.