Re: Http_client infinite loop

Gerd Stolpmann <[email protected]> Sun, 10 Jul 2005 12:23:47 +0200
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <[email protected]>
Am Samstag, den 09.07.2005, 18:26 +0100 schrieb Richard Jones:
> Great.  I've checked out the code and have a few questions.
> 
> > - You can set multiple (e.g. cookie) headers
> > - One can download large files to disk, or upload large files from disk
> 
> If I #set_response_body_storage `Memory, what happens if the response
> is larger than 16 MB?

This will fail.

Well, you can write your own mime_body that handles large bodies in
memory, e.g. by using arrays of strings. (I am very open to
contributions to ocamlnet...)

> Presumably #response_body returns a mime_body_ro, and I can then use
> #response_body#open_value_rd () to get an in_obj_channel, but is there
> a way to pass this smoothly into PXP?  

Yes, PXP can read directly from an in_obj_channel
(Pxp_types.from_obj_channel).

> I'd prefer not to have to mess
> with temporary files if that is avoidable.
> 
> > - No performance problems for large downloads
> 
> Never noticed any performance problems before, but this is still a
> good thing!

The old implementation scanned the whole received message body every
time a new network packet was appended to it. The new implementation
uses a continuation-based parser that doesn't have this deficiency.

> > - Support for non-standard HTTP methods
> > - Improved authentication framework
> > - Improved compatibility to ocamlnet, esp. headers and bodies are
> >   represented with the classes defined in Netmime.
> > - Experimental support for connection caching
> 
> Connection caching is useful when you have multiple pipelines, right?
> In all our programs we share a single pipeline (they are all single
> threaded), so I'm assuming we would never need to use this feature.

The cache keeps the connections open after the pipeline has run -
normally the connections are closed when all requests are processed.
This is useful even if you have only a single pipeline. The drawback is
that the user is now responsible for the connections, and should close
them when they aren't used for a longer period of time.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
[email protected]          http://www.gerd-stolpmann.de
------------------------------------------------------------




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar