W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1998

Accept/Response headers (was: chunk example crashing if iterated)

From: Filippo Menczer <fil@cs.ucsd.edu>
Date: Tue, 9 Jun 1998 16:01:43 -0400 (EDT)
Message-Id: <v02140b0bb1a33ecc562f@[137.110.58.121]>
To: Henrik Frystyk Nielsen <frystyk@w3.org>, www-lib@w3.org
Cc: fil@cs.ucsd.edu, graziano@cs.ucsd.edu
Thank you Henrik,

following your suggestion we were eventually able to make some progress.
Another problem was with persistent sockets/connections, which we would
like to disable for sequential requests; we got around it by calling
HTChannel_deleteAll() after each request. Is there a cleaner way?

The new problem is that we are using converters for the sole purpose of
accepting only text and html documents (is there another way?), as follows:

   /* once at initialization */
   HTList *converters = HTList_new(); /* global */
   HTConversion_add(converters, "text/html", "www/present", HTThroughLine,
2.0, 0.0, 0.0);
   HTConversion_add(converters, "text/plain", "www/present", HTThroughLine,
2.0, 0.0, 0.0);
   HTConversion_add(converters, "text/x-http", "www/present",
HTThroughLine, 2.0, 0.0, 0.0);
   HTFormat_setConversion(converters);

   /* for each request */
   HTRequest_setOutputFormat(request, WWW_PRESENT);
   /* ... */
   chunk = HTLoadToChunk(absolute_url, request);
   /* etc... */

This has the undesired side effect that the chunks returned contain
something like the following, which I believe is the response header:

        ffb
        HTTP/1.1 200 OK
        Date: Tue, 09 Jun 1998 19:30:03 GMT
        Server: Apache/1.2.5
        Keep-Alive: timeout=15, max=100
        Connection: Keep-Alive
        Transfer-Encoding: chunked
        Content-Type: text/html
        f3f

They appear at random places somewhere in the chunk. How do we
avoid this?

Any assistance will be greatly appreciated; again, please reply by
email as well, since I am not a subscriber of the list. Thanks!!!

At 9:02 AM 6/1/98, Henrik Frystyk Nielsen wrote:
>At 20:47 5/30/98 -0400, Filippo Menczer wrote:
>>Could someone help me figure out why this simple example is crashing?
>>Basically I am calling the code in the "chunk" example multiple times
>>by wrapping a loop around it. The first time it goes fine, the second
>>causes a segmentation fault.
>>
>>Configuration:
>>        Linux (on a Pentium II box)
>>        w3c-libwww-5.1m (statically linked)
>
>Try and move the profile stuff (which does all the initialization of libwww
>outside your loop.
>
>[chunk example code snipped]


====================================================
Filippo Menczer         http://www.cs.ucsd.edu/~fil/
fil@cs.ucsd.edu         CSE Dept., 0114
Lab:  (619) 453-4364    U. C. San Diego
Fax:  (619) 534-7029    La Jolla, CA 92093-0114, USA
====================================================
Please note future email:  filippo-menczer@uiowa.edu
====================================================
Received on Tuesday, 9 June 1998 16:12:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:27 GMT