- From: Henrik Frystyk Nielsen <frystyk@microsoft.com>
- Date: Thu, 6 Jan 2000 18:41:07 -0800
- To: <www-lib@w3.org>
- Cc: "Judin, Victor" <victor.judin@materna.de>
Is this a common problem? Henrik Frystyk Nielsen, mailto:frystyk@microsoft.com ----- Original Message ----- From: "Judin, Victor" <victor.judin@materna.de> To: "'Henrik Frystyk Nielsen'" <frystyk@w3.org> Sent: Monday, December 27, 1999 06:16 Subject: LibWWW > > Hello Henrik, > > I've recently examined the LibWWW code , namely TReader_read[ HTReader.c ], > and following situation seems suspect to me: > if HTHost has more than a single HTNet( many pending requests to the host ), > and the server/proxy sends responses to these requests in a single TCP > packet( for example, 2 responses in a single packet ), which contains more > than 1 response, only the first pending HTNet will be callbacked, the rest > of TCP packet will be simply discarded, and the corresponding request(s) > will time out . Can you tell me, if I'm right, or have I overseen > something? > > Another point: in the same function, if precondition ( me->write >= me->read > )fails, NETREAD will not be called. Therefore, the user application never > gets to know, if the far end ( HTHost object which stands in 1:1 relation to > HTReader )has closed the connection( I've seen the situation myself with the > Netscape server and LibWWW-based client ). As quick-and-dirty workaround( > signal handling (EINTR) not shown): > > /*============== HTReader_read================*/ > /*.............*/ > fd_set fdR; > > struct timeval tv = { 0, 0 };/* bail out from select > immediately, real select() was called already in HTevtLst.c */ > /*.............*/ > FD_CLR( &fdR ); > FD_SET( soc, &fdR ); > > if( select( soc + 1, &fdR, NULL, NULL, &tv ) > 0 ) > > #ifdef FIONREAD > #ifndef _WINDOWS > #define ioctlsocket ioctl > #endif > /* > ** POSIX undocumented but defined on most UNIXes( sun, BSD,..). Documented > on Windows.. > */ > int iBufLength = 0; > if(( ioctlsocket( soc, FIONREAD, &iBufLength ) < 0 ) > || (iBufLength == 0)) > #else > /* > ** Don't really remove the byte( MSG_PEEK ) > */ > char cBuf[ 1 ]; > if ( recv( soc, cBuf, sizeof( cBuf ), MSG_PEEK ) == > 0 ) > #endif > { > EventOrder_add( s, HTEvent_CLOSE, > HTGetTimeInMillies()); > return HT_CLOSED; > } > } > /*......................*/ > > > Merry Christmas! > > Victor Judin >
Received on Thursday, 6 January 2000 21:43:07 UTC