[Prev][Next][Index][Thread]
Re: BUG: preemptive operation fails under libwww-5.1
At 06:06 PM 4/2/97, QingLong wrote:
>Conrad <conradh@harlequin.co.uk> wrote:
>>
>> Library: libwww-5.1
>> System: Solaris 2.5, sparc
>> ......
>> the library hangs in a read after retrieving uncached documents.
>>
> Does it hang or go to a deadloop? Have you tried to trace debug it?
The problem was that the output buffer wasn't explicitly flushed which
caused the request newer to be written to the socket. In non-preemptive
mode, there is a timeout forcing a flush after 50 ms but that doesn't
happen when using blocking sockets.
Also, you need to disable the persistent cache when using blocking sockets
- otherwise you run into trouble.
I have included a patch below.
Henrik
Index: HTTP.c
===================================================================
RCS file: /afs/w3.org/CVS-Repository/WWW/Library/src/HTTP.c,v
retrieving revision 1.150
diff -c -r1.150 HTTP.c
*** /tmp/T0a007Dp Wed Apr 2 13:21:37 1997
--- HTTP.c Wed Apr 2 12:18:16 1997
***************
*** 871,876 ****
--- 871,881 ----
HTHost_setVersion(host, HTTP_10);
}
+ if (HTNet_preemptive(net)) {
+ if (PROT_TRACE) HTTrace("HTTP........ Force flush on preemptive load\n");
+ HTRequest_setFlush(request, YES);
+ }
+
/* Jump to next state */
http->state = HTTP_NEED_STREAM;
} else if (status == HT_WOULD_BLOCK || status == HT_PENDING)
--
Henrik Frystyk Nielsen, <frystyk@w3.org>
World Wide Web Consortium, MIT/LCS NE43-346
545 Technology Square, Cambridge MA 02139, USA
Follow-Ups:
References: