[Prev][Next][Index][Thread]

Patches to libwww-4.1b1



I downloaded the latest version of libwww today. I had couple of problems
with it though. The appended patches fix(or try to at least) :

1. gcc complained about "socket" being undefined in HTHost.c, so I changed
this to "sockfd" to make things compile.

2. The MIME parser function didn't work correctly, it left the LF('\n')
terminating the HTTP-headers as the first character in the downloaded
document. I'm not familiar with the code, but I think my patch should be
okay. It works for me at least.

3. The HTEventgr_Loop function didn't initialize the HTEndLoop
variable. This made the HTEventgr_Loop function terminate without finishing
a request.

Since all the patches are one-liners I didn't bother to uuencode. So you'll
probably have to apply them by hand. 

	Gunnar

diff -rc w3c-libwww-4.1b1//Library/src/HTEvntrg.c w3c-libwww-current//Library/src/HTEvntrg.c
*** w3c-libwww-4.1b1//Library/src/HTEvntrg.c	Fri Jun  7 06:42:25 1996
--- w3c-libwww-current//Library/src/HTEvntrg.c	Mon Jun 10 20:06:55 1996
***************
*** 655,661 ****
  #ifdef _WINSOCKAPI_
      unsigned ui ;
  #endif
! 
      /* Don't leave this loop until we the application */
      do { 
          treadset = read_fds;
--- 655,661 ----
  #ifdef _WINSOCKAPI_
      unsigned ui ;
  #endif
!     HTEndLoop = 0;
      /* Don't leave this loop until we the application */
      do { 
          treadset = read_fds;
diff -rc w3c-libwww-4.1b1//Library/src/HTHost.c w3c-libwww-current//Library/src/HTHost.c
*** w3c-libwww-4.1b1//Library/src/HTHost.c	Tue Jun  4 23:46:35 1996
--- w3c-libwww-current//Library/src/HTHost.c	Mon Jun 10 18:33:10 1996
***************
*** 263,269 ****
  	} else {
  	    if (CORE_TRACE)
  		HTTrace("Host info... no room for persistent socket %d\n",
! 			socket);
  	}
      }
      return NO;
--- 263,269 ----
  	} else {
  	    if (CORE_TRACE)
  		HTTrace("Host info... no room for persistent socket %d\n",
! 			sockfd);
  	}
      }
      return NO;
*** w3c-libwww-4.1b1//Library/src/HTMIME.c	Fri Jun  7 06:42:26 1996
--- w3c-libwww-current//Library/src/HTMIME.c	Mon Jun 10 19:23:46 1996
***************
*** 204,211 ****
  		start=b, end=b;
  		status = _dispatchParsers(me);
  		if (me->EOLstate == EOL_END) {		/* EOL_END */
! 		    if (status == HT_OK)
  		        status = pumpData(me);
  		    HTNet_setBytesRead(me->net, l);
  	        } else {				/* EOL_LINE */
  		    HTChunk_clear(me->token);
--- 204,214 ----
  		start=b, end=b;
  		status = _dispatchParsers(me);
  		if (me->EOLstate == EOL_END) {		/* EOL_END */
! 		  if (status == HT_OK){
  		        status = pumpData(me);
+ 			b++;
+ 			l--;
+ 		  }
  		    HTNet_setBytesRead(me->net, l);
  	        } else {				/* EOL_LINE */
  		    HTChunk_clear(me->token);