unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Chunked Encoding
@ 2011-09-29 20:09 Ian Price
  2012-01-04 20:18 ` Andy Wingo
  0 siblings, 1 reply; 9+ messages in thread
From: Ian Price @ 2011-09-29 20:09 UTC (permalink / raw)
  To: guile-devel


Hi guilers,

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'.

  (read-chunk port)
  reads one chunk from a port.

  (read-chunked-response-body response)
  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,
Ian

-- 
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-08  6:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-29 20:09 Chunked Encoding Ian Price
2012-01-04 20:18 ` Andy Wingo
2012-05-06  4:52   ` Ian Price
2012-05-06 16:53     ` Ian Price
2012-05-08  0:33       ` Ian Price
2012-05-06 19:49     ` Thien-Thi Nguyen
2012-05-08  2:27       ` Ian Price
2012-05-08  6:26         ` Thien-Thi Nguyen
2012-05-08  3:26     ` Daniel Hartwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).