W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

Re: libwww flow control?

From: Peter Chan <pchan@netgravity.com>
Date: Fri, 26 Feb 1999 11:41:05 -0800
Message-ID: <002601be61bf$f31092b0$808875d1@netgravity.com>
To: <frystyk@w3.org>, <www-lib@w3.org>
Thanks for the quick reply.  I tried the patch, but mget still failes with
status = HT_INTERRUPTED (-902) after 50 requests.  I am trying this against
an Apache 1.3.3 server, which is supposedly HTTP 1.1.

Peter

----- Original Message -----
From: Henrik Frystyk Nielsen <frystyk@w3.org>
Newsgroups: w3c.www-lib
To: <pchan@netgravity.com>; <raff@nuvomedia.com>
Sent: Friday, February 26, 1999 7:37 AM
Subject: Re: libwww flow control?


>
>
>Henrik Frystyk Nielsen wrote:
>
>> !>      I do something similar on Win98, sending one request only when
the
>> !>      previous terminates, and I get the error too, but I cannot figure
>> !>      out what's going on (some sites always generate the error, some
>> !>      sites don't).
>
>Now I see what is going on - the problem is with old HTTP/1.0 server
>which don't send any content length header field in the response. Libwww
>mistook this as the connection being closed prematurely - in fact the
>download work out just fine.
>
>Try this patch - it also allows Mikhail Grouchinski to figure out how
>many requests are active/pending on a host object :)
>
>--
>Henrik Frystyk Nielsen,
>World Wide Web Consortium
>http://www.w3.org/People/Frystyk


----------------------------------------------------------------------------
----

>Index: Library/src/HTHost.c
>===================================================================
>RCS file: /sources/public/libwww/Library/src/HTHost.c,v
>retrieving revision 2.59
>diff -r2.59 HTHost.c
>1223a1224,1233
>> PUBLIC int HTHost_numberOfOutstandingNetObjects (HTHost * host)
>> {
>>     return host ? HTList_count(host->pipeline) : -1;
>> }
>>
>> PUBLIC int HTHost_numberOfPendingNetObjects (HTHost * host)
>> {
>>     return host ? HTList_count(host->pending) : -1;
>> }
>>
>Index: Library/src/HTHost.html
>===================================================================
>RCS file: /sources/public/libwww/Library/src/HTHost.html,v
>retrieving revision 2.26
>diff -r2.26 HTHost.html
>427a428,437
>>   How many Pending and Outstanding Net objects are there on a Host?
>> </H3>
>> <P>
>> You can query how many Het objects (essentially requests) are outstanding
>> or pending on a host object using these methods:
>> <PRE>
>> extern int HTHost_numberOfOutstandingNetObjects (HTHost * host);
>> extern int HTHost_numberOfPendingNetObjects (HTHost * host);
>> </PRE>
>> <H3>
>Index: Library/src/HTTP.c
>===================================================================
>RCS file: /sources/public/libwww/Library/src/HTTP.c,v
>retrieving revision 1.178
>diff -r1.178 HTTP.c
>25a26
>> #include "HTNetMan.h"
>990,992c991,1006
>< HTRequest_addError(request, ERR_FATAL, NO, HTERR_INTERRUPTED,
><    NULL, 0, "HTLoadHTTP");
>< HTTPCleanup(request, HT_INTERRUPTED);
>---
>>         long read_len = HTNet_bytesRead(net);
>>         long doc_len = HTAnchor_length(anchor);
>>
>>         /*
>>         ** It is OK to get a close if a) we don't pipeline and b)
>>         ** we have the expected amount of data. In case we don't
>>         ** know how much data to expect, we must accept it asis.
>>         */
>>         if (HTHost_numberOfOutstandingNetObjects(host) == 1 &&
>>             (doc_len<0 || doc_len==read_len)) {
>>     HTTPCleanup(request, HT_LOADED);
>>         } else {
>>             HTRequest_addError(request, ERR_FATAL, NO, HTERR_INTERRUPTED,
>>        NULL, 0, "HTLoadHTTP");
>>     HTTPCleanup(request, HT_INTERRUPTED);
>>         }
>
Received on Friday, 26 February 1999 14:44:30 GMT

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