[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 29 Sep 2011 21:09:18 +0100
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
If you've used the (web ...) modules, you may have noticed that guile
does not currently support chunked-encoding. This is expected in a
HTTP/1.1 world, so I wrote an implementation to cover my immediate
need, but I'm not particularly convinced of it, so I wanted to discuss
this before sending a patch.
What I did was introduce two new exported procedures for reading (all I
needed at the moment), namely 'read-chunk' and 'read-chunked-response-body'.
reads one chunk from a port.
read the full body for the response and returns it as a bytevector. It
was written to be similar to 'read-response-body'.
For writing chunks then, the obvious thing is to write two procedures
'write-chunk' and 'write-chunked-response-body' which perform the
inverse. However, it seems to me that 'write-chunked-response-body' is a
practically useless procedure, because if you ever had a full body, you
can just use 'write-response-body'.
Another option I've been thinking over would be to go for a sort of
chunking version of R6RS' 'transcoded-port' which would handle it
transparently for users of the returned port.
I'd also suggest extending 'http-get' from (web client) to handle
chunked encoding (and trailers too, I guess) for the user.
Comments kindly requested,
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
|[Prev in Thread]
||[Next in Thread]|
- Chunked Encoding,
Ian Price <=