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

Bug in HTBufWrt.c

From: Michel Philip <mphilip@infovista.com>
Date: Mon, 11 Jun 2001 06:15:01 -0400 (EDT)
Message-ID: <F520B214418AD4119F7000508BD90CC294B8C9@hq01sr02.infovista.com>
To: "'www-lib@w3.org'" <www-lib@w3.org>
Hi all,

There is an infinite loop in HTBufWrt.c

In the function HTBufferWrite_write the code is :

while (1 ) {
  int available = me->data + me->allocated - me->read;
  /* If we have enough buffer space */
  if (len <= available) {
    ... 
   status = PUTBLOCK(...)
    (1)
  } else {
    ... 
   status = PUTBLOCK(...)
    (2)
  }   
}

Code (1) always returns.
Code (2) returns only if (status == HT_WOULD_BLOCK).
             It continues in the loop if (status == HT_OK).
       What about other status values ?
       If the remote host for any reason close the connection
       status will be HT_ERROR and the  HTBufferWrite_write 
       goes in infinite loop.

I suggest the following patch in line 210 :
   else return HT_ERROR;


MP.


               
Received on Monday, 11 June 2001 06:16:05 GMT

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