RE: How to submit.

Okay,

Here is the text diff output to use with patch.

--------------------Cut here----------------------
diff -c -r -X excludedfiles libwww/Library/Examples/LoadToFile.c
libwww.AIX.copy/Library/Examples/LoadToFile.c
*** libwww/Library/Examples/LoadToFile.c	Mon Aug  9 10:17:38 1999
--- libwww.AIX.copy/Library/Examples/LoadToFile.c	Tue Feb  8 16:40:23
2000
***************
*** 67,73 ****
      HTProfile_newNoCacheClient(APP_NAME, APP_VERSION);
  
      /* And the traces... */
! #if 0
      HTSetTraceMessageMask("sop");
  #endif
  
--- 67,73 ----
      HTProfile_newNoCacheClient(APP_NAME, APP_VERSION);
  
      /* And the traces... */
! #if 1
      HTSetTraceMessageMask("sop");
  #endif
  
diff -c -r -X excludedfiles libwww/Library/src/HTAccess.c
libwww.AIX.copy/Library/src/HTAccess.c
*** libwww/Library/src/HTAccess.c	Mon Aug  9 10:18:06 1999
--- libwww.AIX.copy/Library/src/HTAccess.c	Wed Feb  9 08:08:10 2000
***************
*** 73,79 ****
  	HTTRACE(PROT_TRACE, "HTAccess.... Accessing document %s\n" _
full_address);
  	HT_FREE(full_address);
      }
! #endif / * HTDEBUG */
      return HTLoad(request, recursive);
  }
  
--- 73,79 ----
  	HTTRACE(PROT_TRACE, "HTAccess.... Accessing document %s\n" _
full_address);
  	HT_FREE(full_address);
      }
! #endif
      return HTLoad(request, recursive);
  }
  
***************
*** 753,758 ****
--- 753,784 ----
      return NULL;
  }
  
+ /*
+ **	Post and then get data back from URL to a mem buffer
+ **	--------------------------
+ **	Load a request and store the result in a memory buffer.
+ **	Returns chunk if OK - else NULL
+ */
+ PUBLIC HTChunk *HTPostAnchorToChunk(HTParentAnchor *source, HTAnchor
*destination,
+         HTRequest * request)
+ {
+     HTChunk *aChunk = NULL;
+ 
+     HTStream *target = HTStreamToChunk(request, &aChunk, NULL);
+     HTRequest_setOutputStream(request, target);
+ 
+     /*
+     ** Request a document referenced by an anchor.
+     ** Put the information into the anchor.
+     */
+     if(HTPostAnchor(source, destination, request) == NO)
+     {
+         HTChunk_delete(aChunk);
+         aChunk = NULL;
+     }
+ 
+     return aChunk;
+ }
  
  /*
--------------------------------------------------------------------------*/
  /*				PUT A DOCUMENT
*/
diff -c -r -X excludedfiles libwww/Library/src/HTAccess.h
libwww.AIX.copy/Library/src/HTAccess.h
*** libwww/Library/src/HTAccess.h	Mon Aug  9 16:29:11 1999
--- libwww.AIX.copy/Library/src/HTAccess.h	Wed Feb  9 08:07:51 2000
***************
*** 424,430 ****
--- 424,445 ----
  extern HTChunk * HTPostFormAnchorToChunk (HTAssocList * formdata,
                                            HTAnchor *    anchor,
                                            HTRequest *   request);
+ /*
+ (
+   Submit Anchor and Save the Result in a Memory Buffer
+ )
  
+ Submit HTAnchor to the address referred to by another
+ HTAnchor object and load the result of the POST
+ into a HTChunk object. A
+ chunk object is a dynamic memory buffer so in
+ the end you will have a single memory buffer containing the document. The
+ chunk must be freed by the caller.
+ */
+ 
+ extern HTChunk *HTPostAnchorToChunk(HTParentAnchor *source,
+                                     HTAnchor *destination,
+                                     HTRequest * request);
  /*
  .
    Get Metainformation about a Document (Method = HEAD)
diff -c -r -X excludedfiles libwww/Library/src/HTAnchor.c
libwww.AIX.copy/Library/src/HTAnchor.c
*** libwww/Library/src/HTAnchor.c	Mon Aug  9 10:18:07 1999
--- libwww.AIX.copy/Library/src/HTAnchor.c	Wed Feb  9 08:57:39 2000
***************
*** 1399,1401 ****
--- 1399,1416 ----
      if (me->headers) HTAssocList_delete(me->headers);
      me->headers = NULL;
  }
+ 
+ PUBLIC void HTAnchor_removeSource (HTParentAnchor* me, HTAnchor* src)
+ {
+     HTList *linkList;
+ 
+     if(!me || !src)
+         return;
+ 
+     linkList = me->sources;
+ 
+     if(linkList)
+         HTList_removeObject(linkList, src);
+ 
+     return;
+ }
diff -c -r -X excludedfiles libwww/Library/src/HTAnchor.h
libwww.AIX.copy/Library/src/HTAnchor.h
*** libwww/Library/src/HTAnchor.h	Mon Aug  9 16:29:11 1999
--- libwww.AIX.copy/Library/src/HTAnchor.h	Wed Feb  9 08:08:21 2000
***************
*** 369,374 ****
--- 369,380 ----
  extern void HTAnchor_clearHeader	(HTParentAnchor *me);
  
  /*
+    If the source is not removed when added each time a list of them
+    just keep building up within the cached anchor.
+  */
+ extern void HTAnchor_removeSource (HTParentAnchor* me, HTAnchor* src);
+ 
+ /*
  (
    Inherit Metainformation from the Response object
  )
diff -c -r -X excludedfiles libwww/Library/src/HTAtom.c
libwww.AIX.copy/Library/src/HTAtom.c
*** libwww/Library/src/HTAtom.c	Mon Aug  9 10:18:07 1999
--- libwww.AIX.copy/Library/src/HTAtom.c	Tue Feb  8 16:11:03 2000
***************
*** 33,39 ****
  PUBLIC HTAtom * HTAtom_for (const char * string)
  {
      int hash;
!     const unsigned char * p;
      HTAtom * a;
  
      if (!string) return NULL;			/* prevent core dumps */
--- 33,39 ----
  PUBLIC HTAtom * HTAtom_for (const char * string)
  {
      int hash;
!     const char * p;
      HTAtom * a;
  
      if (!string) return NULL;			/* prevent core dumps */
***************
*** 48,54 ****
      /*		Generate hash function
      */
      for (p=string, hash=0; *p; p++) {
!         hash = (hash * 3 + TOLOWER(*p)) % HT_XL_HASH_SIZE;
      }
      
      /*		Search for the string in the list
--- 48,54 ----
      /*		Generate hash function
      */
      for (p=string, hash=0; *p; p++) {
!         hash = (hash * 3 + (unsigned char)(TOLOWER(*p))) %
HT_XL_HASH_SIZE;
      }
      
      /*		Search for the string in the list
***************
*** 82,88 ****
  PUBLIC HTAtom * HTAtom_caseFor (const char * string)
  {
      int hash;
!     const unsigned char * p;
      HTAtom * a;
  
      if (!string) return NULL;			/* prevent core dumps */
--- 82,88 ----
  PUBLIC HTAtom * HTAtom_caseFor (const char * string)
  {
      int hash;
!     const char * p;
      HTAtom * a;
  
      if (!string) return NULL;			/* prevent core dumps */
***************
*** 97,103 ****
      /*		Generate hash function
      */
      for(p=string, hash=0; *p; p++) {
!         hash = (hash * 3 + TOLOWER(*p)) % HT_XL_HASH_SIZE;
      }
      
      /*		Search for the string in the list
--- 97,103 ----
      /*		Generate hash function
      */
      for(p=string, hash=0; *p; p++) {
!         hash = (hash * 3 + (unsigned char)(TOLOWER(*p))) %
HT_XL_HASH_SIZE;
      }
      
      /*		Search for the string in the list
diff -c -r -X excludedfiles libwww/Library/src/HTBind.c
libwww.AIX.copy/Library/src/HTBind.c
*** libwww/Library/src/HTBind.c	Mon Aug  9 10:18:08 1999
--- libwww.AIX.copy/Library/src/HTBind.c	Tue Feb  8 16:11:04 2000
***************
*** 189,199 ****
      else {
  	HTList * suflist;
  	int hash;
! 	const unsigned char * p;
  
  	/* Select list from hash table */
  	for (p=suffix, hash=0; *p; p++) {
! 	    hash = (hash * 3 + TOLOWER(*p)) % HT_L_HASH_SIZE;
  	}
  
  	if (!HTBindings) HTBind_init();
--- 189,199 ----
      else {
  	HTList * suflist;
  	int hash;
! 	const char * p;
  
  	/* Select list from hash table */
  	for (p=suffix, hash=0; *p; p++) {
! 	    hash = (hash * 3 + (unsigned char)(TOLOWER(*p))) %
HT_L_HASH_SIZE;
  	}
  
  	if (!HTBindings) HTBind_init();
***************
*** 431,436 ****
--- 431,439 ----
  #ifdef HT_REENTRANT
      char *lasts;					     /* For strtok_r
*/
  #endif
+ 
+     char *p;
+ 
      if (!HTBindings) HTBind_init();
      if (*quality < HT_EPSILON)
  	*quality = 1.0;			           /* Set to a neutral value
*/
***************
*** 449,461 ****
  #endif /* HT_REENTRANT */
  	    HTBind *suff=NULL;
  	    int hash;
- 	    unsigned char * p;
  	    HTTRACE(BIND_TRACE, "Get Binding. Look for '%s\' " _ suffix);
  	    sufcnt++;
  
  	    /* Select list from hash table */
  	    for (p=suffix, hash=0; *p; p++) {
! 		hash = (hash * 3 + TOLOWER(*p)) % HT_L_HASH_SIZE;
  	    }
  
  	    /* Now search list for entries (case or non case sensitive) */
--- 452,463 ----
  #endif /* HT_REENTRANT */
  	    HTBind *suff=NULL;
  	    int hash;
  	    HTTRACE(BIND_TRACE, "Get Binding. Look for '%s\' " _ suffix);
  	    sufcnt++;
  
  	    /* Select list from hash table */
  	    for (p=suffix, hash=0; *p; p++) {
!             hash = (hash * 3 + (unsigned char)(TOLOWER(*p))) %
HT_L_HASH_SIZE;
  	    }
  
  	    /* Now search list for entries (case or non case sensitive) */
diff -c -r -X excludedfiles libwww/Library/src/HTBufWrt.c
libwww.AIX.copy/Library/src/HTBufWrt.c
*** libwww/Library/src/HTBufWrt.c	Mon Aug  9 10:18:08 1999
--- libwww.AIX.copy/Library/src/HTBufWrt.c	Tue Feb  8 16:11:04 2000
***************
*** 275,281 ****
  	    */
  	    {
  		SOCKET sockfd = HTChannel_socket(ch);
! 		int size = sizeof(int);
  		int status = getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF,
  					(void *) &tcpbufsize, &size);
  		if (status == -1) {
--- 275,281 ----
  	    */
  	    {
  		SOCKET sockfd = HTChannel_socket(ch);
! 		unsigned long size = sizeof(int);
  		int status = getsockopt(sockfd, SOL_SOCKET, SO_SNDBUF,
  					(void *) &tcpbufsize, &size);
  		if (status == -1) {
diff -c -r -X excludedfiles libwww/Library/src/HTDNS.c
libwww.AIX.copy/Library/src/HTDNS.c
*** libwww/Library/src/HTDNS.c	Mon Aug  9 10:18:09 1999
--- libwww.AIX.copy/Library/src/HTDNS.c	Tue Feb  8 16:11:04 2000
***************
*** 287,293 ****
  				      HOSTENT_MAX, &thd_errno);
  #else
  	if (cbf) (*cbf)(request, HT_PROG_DNS,
HT_MSG_NULL,NULL,hostname,NULL);
! 	hostelement = gethostbyname(hostname);
  #endif
  	if (!hostelement) {
              HTRequest_addSystemError(request, ERR_FATAL, socerrno, NO,
--- 287,293 ----
  				      HOSTENT_MAX, &thd_errno);
  #else
  	if (cbf) (*cbf)(request, HT_PROG_DNS,
HT_MSG_NULL,NULL,hostname,NULL);
! 	hostelement = (struct hostent *)gethostbyname(hostname);
  #endif
  	if (!hostelement) {
              HTRequest_addSystemError(request, ERR_FATAL, socerrno, NO,
***************
*** 309,315 ****
  PUBLIC char * HTGetHostBySock (int soc)
  {
      struct sockaddr addr;
!     int len = sizeof(struct sockaddr);
      struct in_addr *iaddr;
      char *name = NULL;
      struct hostent * phost;		/* Pointer to host -- See netdb.h */
--- 309,315 ----
  PUBLIC char * HTGetHostBySock (int soc)
  {
      struct sockaddr addr;
!     unsigned long len = sizeof(struct sockaddr);
      struct in_addr *iaddr;
      char *name = NULL;
      struct hostent * phost;		/* Pointer to host -- See netdb.h */
diff -c -r -X excludedfiles libwww/Library/src/HTDigest.c
libwww.AIX.copy/Library/src/HTDigest.c
*** libwww/Library/src/HTDigest.c	Mon Aug  9 10:18:22 1999
--- libwww.AIX.copy/Library/src/HTDigest.c	Tue Feb  8 16:11:10 2000
***************
*** 55,66 ****
      return NO;
  }
  
! PUBLIC BOOL HTDigest_final (unsigned char *digest, HTDigestContext
*context)
  {
      if (context) {
  	switch (context->algorithm) {
  	case HTDaMD5:
! 	    MD5Final (digest, &context->context.md5);
  	    break;
  	default:
  	    return NO;
--- 55,66 ----
      return NO;
  }
  
! PUBLIC BOOL HTDigest_final (char *digest, HTDigestContext *context)
  {
      if (context) {
  	switch (context->algorithm) {
  	case HTDaMD5:
! 	    MD5Final ((unsigned char *)digest, &context->context.md5);
  	    break;
  	default:
  	    return NO;
diff -c -r -X excludedfiles libwww/Library/src/HTDigest.h
libwww.AIX.copy/Library/src/HTDigest.h
*** libwww/Library/src/HTDigest.h	Mon Aug  9 16:29:11 1999
--- libwww.AIX.copy/Library/src/HTDigest.h	Tue Feb  8 16:11:10 2000
***************
*** 71,77 ****
  
  extern BOOL HTDigest_init (HTDigestContext *context, int digesttype);
  extern BOOL HTDigest_update (HTDigestContext *context, char *input,
unsigned int inputLen);
! extern BOOL HTDigest_final (unsigned char *digest, HTDigestContext
*context);
  
  /*
  */
--- 71,77 ----
  
  extern BOOL HTDigest_init (HTDigestContext *context, int digesttype);
  extern BOOL HTDigest_update (HTDigestContext *context, char *input,
unsigned int inputLen);
! extern BOOL HTDigest_final (char *digest, HTDigestContext *context);
  
  /*
  */
diff -c -r -X excludedfiles libwww/Library/src/HTEvtLst.c
libwww.AIX.copy/Library/src/HTEvtLst.c
*** libwww/Library/src/HTEvtLst.c	Mon Aug  9 10:18:10 1999
--- libwww.AIX.copy/Library/src/HTEvtLst.c	Wed Feb  9 14:14:31 2000
***************
*** 65,70 ****
--- 65,71 ----
  PRIVATE HTList * EventOrderList = NULL;
  PRIVATE int HTEndLoop = 0;		       /* If !0 then exit event loop
*/
  PRIVATE BOOL HTInLoop = NO;
+ PRIVATE BOOL HTAllowInfiniteTimeout = YES;
  
  #ifdef WWW_WIN_ASYNC
  #define TIMEOUT	1 /* WM_TIMER id */
***************
*** 212,234 ****
      if (sockp->timeouts[HTEvent_INDEX(HTEvent_READ)] == timer) {
  	event = sockp->events[HTEvent_INDEX(HTEvent_READ)];
  	HTTRACE(THD_TRACE, "Event....... READ timed out on %d.\n" _
sockp->s);
! 	return (*event->cbf) (sockp->s, event->param, HTEvent_TIMEOUT);
      }
  
      /* Check for write timeout */
      if (sockp->timeouts[HTEvent_INDEX(HTEvent_WRITE)] == timer) {
  	event = sockp->events[HTEvent_INDEX(HTEvent_WRITE)];
  	HTTRACE(THD_TRACE, "Event....... WRITE timed out on %d.\n" _
sockp->s);
! 	return (*event->cbf) (sockp->s, event->param, HTEvent_TIMEOUT);
      }
  
      /* Check for out-of-band data timeout */
      if (sockp->timeouts[HTEvent_INDEX(HTEvent_OOB)] == timer) {
  	event = sockp->events[HTEvent_INDEX(HTEvent_OOB)];
  	HTTRACE(THD_TRACE, "Event....... OOB timed out on %d.\n" _
sockp->s);
! 	return (*event->cbf) (sockp->s, event->param, HTEvent_TIMEOUT);
      }
!     HTTRACE(THD_TRACE, "Event....... No event for timer %p with context
%p\n" _ timer _ param);
      return HT_ERROR;
  }
  
--- 213,263 ----
      if (sockp->timeouts[HTEvent_INDEX(HTEvent_READ)] == timer) {
  	event = sockp->events[HTEvent_INDEX(HTEvent_READ)];
  	HTTRACE(THD_TRACE, "Event....... READ timed out on %d.\n" _
sockp->s);
!     HTTRACE(THD_TRACE, "Event....... READ calling event %p and its cbf
%p\n" _ 
! 		(void *)event _ (void *) event->cbf);
!     if(event)
!         return (*event->cbf) (sockp->s, event->param, HTEvent_TIMEOUT);
!     else
!     {
!         HTTRACE(THD_TRACE, "Event....... READ event NULL for timer %p with
context %p\n" _
!             timer _ param);
!         return HT_ERROR;
!     }
      }
  
      /* Check for write timeout */
      if (sockp->timeouts[HTEvent_INDEX(HTEvent_WRITE)] == timer) {
  	event = sockp->events[HTEvent_INDEX(HTEvent_WRITE)];
  	HTTRACE(THD_TRACE, "Event....... WRITE timed out on %d.\n" _
sockp->s);
!     HTTRACE(THD_TRACE, "Event....... WRITE calling event %p and its cbf
%p\n" _ 
! 		(void *)event _ (void *) event->cbf);
!     if(event)
!         return (*event->cbf) (sockp->s, event->param, HTEvent_TIMEOUT);
!     else
!     {
!         HTTRACE(THD_TRACE, "Event....... WRITE event NULL for timer %p
with context %p\n" _
!             timer _ param);
!         return HT_ERROR;
!     }
      }
  
      /* Check for out-of-band data timeout */
      if (sockp->timeouts[HTEvent_INDEX(HTEvent_OOB)] == timer) {
  	event = sockp->events[HTEvent_INDEX(HTEvent_OOB)];
  	HTTRACE(THD_TRACE, "Event....... OOB timed out on %d.\n" _
sockp->s);
!     HTTRACE(THD_TRACE, "Event....... OOB calling event %p and its cbf
%p\n" _ 
! 		(void *)event _ (void *) event->cbf);
!     if(event)
!         return (*event->cbf) (sockp->s, event->param, HTEvent_TIMEOUT);
!     else
!     {
!         HTTRACE(THD_TRACE, "Event....... OOB event NULL for timer %p with
context %p\n" _
!             timer _ param);
!         return HT_ERROR;
      }
!     }
!     HTTRACE(THD_TRACE, "Event....... No event for timer %p with context
%p\n" _
!         timer _ param);
      return HT_ERROR;
  }
  
***************
*** 366,372 ****
  	    FD_ISSET(cnt, (FdArray + HTEvent_INDEX(HTEvent_OOB))))
    	    if (cnt > t_max) t_max = cnt;
      }
!     MaxSock = t_max+1;
      HTTRACE(THD_TRACE, "Event....... Reset MaxSock from %u to %u\n" _
old_max _ MaxSock);
      return;
  }  
--- 395,401 ----
  	    FD_ISSET(cnt, (FdArray + HTEvent_INDEX(HTEvent_OOB))))
    	    if (cnt > t_max) t_max = cnt;
      }
!     MaxSock = t_max;
      HTTRACE(THD_TRACE, "Event....... Reset MaxSock from %u to %u\n" _
old_max _ MaxSock);
      return;
  }  
***************
*** 607,612 ****
--- 636,661 ----
  }
  
  /*
+ **  In the event loop turn off the infinite timeout ability.
+ **  Default is to allow infinite timeouts.
+ **  If infinite timeouts are turned off an HT_ERROR is returned.
+ */
+ PUBLIC void HTEventList_NoInfiniteTimeout (void)
+ {
+     HTAllowInfiniteTimeout = NO;
+ }
+ 
+ /*
+ **  In the event loop turn on the infinite timeout ability.
+ **  Default is to allow infinite timeouts.
+ **  If infinite timeouts are turned off an HT_ERROR is returned.
+ */
+ PUBLIC void HTEventList_InfiniteTimeout (void)
+ {
+     HTAllowInfiniteTimeout = YES;
+ }
+ 
+ /*
  **  There are now two versions of the event loop. The first is if you want
  **  to use async I/O on windows, and the other is if you want to use
normal
  **  Unix setup with sockets
***************
*** 669,675 ****
  	    waittime.tv_usec = (timeout % MILLI_PER_SECOND) *
  		(1000000 / MILLI_PER_SECOND);
  	    wt = &waittime;
! 	}
  
  	/*
  	**  Now we copy the current active file descriptors to pass them to
select.
--- 718,732 ----
  	    waittime.tv_usec = (timeout % MILLI_PER_SECOND) *
  		(1000000 / MILLI_PER_SECOND);
  	    wt = &waittime;
! 	}else
!     {
!         if(HTAllowInfiniteTimeout == NO)
!         {
!             /* What about no timers with a request passed?  We go forever?
*/
!             status = HT_ERROR;
!             break; /* Why do you need goto's when a break gets to
stop_loop? */
!         }
!     }
  
  	/*
  	**  Now we copy the current active file descriptors to pass them to
select.
***************
*** 679,685 ****
          texceptset = FdArray[HTEvent_INDEX(HTEvent_OOB)];
  
  	/* And also get the max socket value */
!         maxfds = MaxSock; 
  
  	HTTRACE(THD_TRACE, "Event Loop.. calling select: maxfds is %d\n" _
maxfds);
  #ifdef HTDEBUG
--- 736,748 ----
          texceptset = FdArray[HTEvent_INDEX(HTEvent_OOB)];
  
  	/* And also get the max socket value */
!     maxfds = MaxSock; 
! 
!     if(maxfds == 0)
!     {
! 	    status = HT_ERROR;
!         break; /* Why do you need goto's when a break gets to stop_loop?
*/
!     }
  
  	HTTRACE(THD_TRACE, "Event Loop.. calling select: maxfds is %d\n" _
maxfds);
  #ifdef HTDEBUG
diff -c -r -X excludedfiles libwww/Library/src/HTEvtLst.h
libwww.AIX.copy/Library/src/HTEvtLst.h
*** libwww/Library/src/HTEvtLst.h	Mon Aug  9 16:29:11 1999
--- libwww.AIX.copy/Library/src/HTEvtLst.h	Wed Feb  9 14:16:05 2000
***************
*** 134,139 ****
--- 134,147 ----
  extern BOOL HTEventTerminate (void);
  
  /*
+ .
+     Infinite timeouts in event loop handling.
+ .
+ */
+ extern void HTEventList_NoInfiniteTimeout (void);
+ extern void HTEventList_InfiniteTimeout (void);
+ 
+ /*
  (
    Start the Eventloop
  )
diff -c -r -X excludedfiles libwww/Library/src/HTFTP.c
libwww.AIX.copy/Library/src/HTFTP.c
*** libwww/Library/src/HTFTP.c	Mon Aug  9 10:18:10 1999
--- libwww.AIX.copy/Library/src/HTFTP.c	Tue Feb  8 16:11:04 2000
***************
*** 495,501 ****
      */
      {
  	SockA local_port, local_host;
! 	int addr_size = sizeof(local_port);
  	memset((void *) &local_host, '\0', addr_size);
  	memset((void *) &local_port, '\0', addr_size);
  	if (getsockname(HTNet_socket(cnet),
--- 495,501 ----
      */
      {
  	SockA local_port, local_host;
! 	unsigned long addr_size = sizeof(local_port);
  	memset((void *) &local_host, '\0', addr_size);
  	memset((void *) &local_port, '\0', addr_size);
  	if (getsockname(HTNet_socket(cnet),
diff -c -r -X excludedfiles libwww/Library/src/HTHome.c
libwww.AIX.copy/Library/src/HTHome.c
*** libwww/Library/src/HTHome.c	Mon Aug  9 10:18:12 1999
--- libwww.AIX.copy/Library/src/HTHome.c	Thu Feb 10 09:50:03 2000
***************
*** 146,171 ****
  PUBLIC HTParentAnchor * HTTmpAnchor (HTUserProfile * up)
  {
      static int offset = 0;			    /* Just keep counting...
*/
      time_t t = time(NULL);
      char * tmpfile = HTGetTmpFileName(HTUserProfile_tmp(up));
      char * tmpurl = HTParse(tmpfile, "file:", PARSE_ALL);
!     if (tmpfile && tmpurl && t >= 0) {
! 	char * result;
! 	if (!(result = (char *) HT_MALLOC(strlen(tmpurl)+20)))
! 	    HT_OUTOFMEM("HTTmpAnchor");
! #ifdef HAVE_LONG_TIME_T
! 	sprintf(result, "%s.%ld.%d", tmpurl, t, offset++);
! #else
! 	sprintf(result, "%s.%d.%d", tmpurl, t, offset++);
! #endif
! 	HTTRACE(APP_TRACE, "Tmp Anchor.. With location `%s\'\n" _ result);
! 	return HTAnchor_parent(HTAnchor_findAddress(result));
! 	HT_FREE(result);
      }
      HT_FREE(tmpfile);
      HT_FREE(tmpurl);
!     return NULL;
  }
  
  /*
  **	Takes a string of the form "a=b" containing HTML form data, escapes
--- 146,226 ----
  PUBLIC HTParentAnchor * HTTmpAnchor (HTUserProfile * up)
  {
      static int offset = 0;			    /* Just keep counting...
*/
+     HTParentAnchor *retPAnchor = NULL;
      time_t t = time(NULL);
      char * tmpfile = HTGetTmpFileName(HTUserProfile_tmp(up));
      char * tmpurl = HTParse(tmpfile, "file:", PARSE_ALL);
!     if (tmpfile && tmpurl && t >= 0)
!     {
!         char * result;
! 
!         if (!(result = (char *) HT_MALLOC(strlen(tmpurl)+20)))
!             HT_OUTOFMEM("HTTmpAnchor");
! 
!         #ifdef HAVE_LONG_TIME_T
!             sprintf(result, "%s.%ld.%d", tmpurl, t, offset++);
!         #else
!             sprintf(result, "%s.%d.%d", tmpurl, t, offset++);
!         #endif
! 
!         HTTRACE(APP_TRACE, "Tmp Anchor.. With location `%s\'\n" _ result);
! 
!         retPAnchor = HTAnchor_parent(HTAnchor_findAddress(result));
! 
!         HT_FREE(result);
!         /* Fall Through */
      }
+ 
      HT_FREE(tmpfile);
      HT_FREE(tmpurl);
! 
!     return retPAnchor;
  }
+ 
+ #ifdef HAVE_GETPID
+ PUBLIC HTParentAnchor * HTTmpAnchorByPID (HTUserProfile * up)
+ {
+     HTParentAnchor *retPAnchor = NULL;
+     char tmpfile[PATH_MAX+1];
+     char *tmpfileptr = NULL;
+     static char * tmpurl = NULL;
+ 
+     /* This if(tmpurl == NULL) is for initialization. */
+     /* It cannot be the else with the if(tmpurl) below. */
+     if(tmpurl == NULL)
+     {
+         /* I wish there was a way to just get the tmp directory and then
+            name it anything I want but that is a little bit complicated.
+            Technically the pid stuff below could be ignored but...
+            I guess for the moment this routine will work but the
+            cleanup of new anchors would be better.  Oh well.. */
+         tmpfileptr = HTGetTmpFileName(HTUserProfile_tmp(up));
+         /* In the future when the library goes thread safe do:
+             sprintf(tmpfile,"%s.%d", tmpfileptr, getpid(), thread_name());

+             --- thread_name() is a helper function taken out of the ---
+             --- book Multithreaded Programming with pthreads"       ---
+             --- by Bil Lewis and Daniel J. Berg                     --- 
+          */
+         sprintf(tmpfile,"%s.%d", tmpfileptr, getpid()); 
+         tmpurl = HTParse(tmpfile, "file:", PARSE_ALL);
+     }
+ 
+     /* This if(tmpurl) is in case of HTParse returning NULL. */
+     if (tmpurl)
+     {
+         HTTRACE(APP_TRACE, "Tmp Anchor By PID.. With location `%s\'\n" _
tmpurl);
+         retPAnchor = HTAnchor_parent(HTAnchor_findAddress(tmpurl));
+         /* Fall Through */
+     }
+ 
+     if(tmpfileptr) HT_FREE(tmpfileptr);
+ 
+     /* This is now static. */
+     /* HT_FREE(tmpurl); */
+ 
+     return retPAnchor;
+ }
+ #endif /* HAVE_GETPID */
  
  /*
  **	Takes a string of the form "a=b" containing HTML form data, escapes
diff -c -r -X excludedfiles libwww/Library/src/HTHome.h
libwww.AIX.copy/Library/src/HTHome.h
*** libwww/Library/src/HTHome.h	Mon Aug  9 16:29:12 1999
--- libwww.AIX.copy/Library/src/HTHome.h	Wed Feb  9 07:59:33 2000
***************
*** 102,107 ****
--- 102,117 ----
  
  extern HTParentAnchor * HTTmpAnchor (HTUserProfile * up);
  
+ #ifdef HAVE_GETPID
+ /* Same as above but the same temporary file is used for each call. */
+ /* This means that this is not thread safe but it doesn't leak a new
+    anchor each call like HTTmpAnchor does. */
+ /* Right now the pid of the process is appended instead of an internal
+    count.  Maybe to be thread safe the pid and tid of the process
+    can be added to make it thread safe. */
+ extern HTParentAnchor * HTTmpAnchorByPID (HTUserProfile * up);
+ #endif
+ 
  /*
  .
    Get The Current Directory in URL form
diff -c -r -X excludedfiles libwww/Library/src/HTIcons.c
libwww.AIX.copy/Library/src/HTIcons.c
*** libwww/Library/src/HTIcons.c	Mon Aug  9 10:18:12 1999
--- libwww.AIX.copy/Library/src/HTIcons.c	Tue Feb  8 16:11:05 2000
***************
*** 1,4 ****
! /*
HTIcon.c
  **	ICON MANAGEMENT
  **
  **	(c) COPYRIGHT MIT 1995.
--- 1,4 ----
! /* 							       HTIcon.c
  **	ICON MANAGEMENT
  **
  **	(c) COPYRIGHT MIT 1995.
***************
*** 152,157 ****
--- 152,160 ----
  PUBLIC BOOL HTIcon_addUnknown (const char * url, const char * prefix,
  			       char * alt)
  {
+     if(icon_unknown && (icon_unknown != icon_blank))
+         HTIcon_delete(icon_unknown);
+ 
      if ((icon_unknown = (HTIconNode *)
HT_CALLOC(1,sizeof(HTIconNode)))==NULL)
          HT_OUTOFMEM("HTAddUnknownIcon");
      if (url) icon_unknown->icon_url = prefixed(url, prefix);
***************
*** 168,173 ****
--- 171,179 ----
  */
  PUBLIC BOOL HTIcon_addBlank (const char * url, const char * prefix, char *
alt)
  {
+     if(icon_unknown && (icon_unknown != icon_blank))
+         HTIcon_delete(icon_blank);
+ 
      if ((icon_blank = (HTIconNode *) HT_CALLOC(1,sizeof(HTIconNode))) ==
NULL)
          HT_OUTOFMEM("HTAddBlankIcon");
      if (url) icon_blank->icon_url = prefixed(url, prefix);
***************
*** 184,189 ****
--- 190,196 ----
  */
  PUBLIC BOOL HTIcon_addParent (const char * url, const char * prefix, char
* alt)
  {
+     HTIcon_delete(icon_parent);
      if ((icon_parent = (HTIconNode *) HT_CALLOC(1,sizeof(HTIconNode))) ==
NULL)
          HT_OUTOFMEM("HTAddBlankIcon");
      if (url) icon_parent->icon_url = prefixed(url, prefix);
***************
*** 200,205 ****
--- 207,213 ----
  */
  PUBLIC BOOL HTIcon_addDir (const char * url, const char * prefix, char *
alt)
  {
+     HTIcon_delete(icon_dir);
      if ((icon_dir = (HTIconNode *) HT_CALLOC(1,sizeof(HTIconNode))) ==
NULL)
          HT_OUTOFMEM("HTAddBlankIcon");
      if (url) icon_dir->icon_url = prefixed(url, prefix);
***************
*** 240,243 ****
--- 248,317 ----
  	return icon_parent ? icon_parent : icon_unknown;
      }
      return icon_unknown;
+ }
+ 
+ PUBLIC BOOL HTIcon_delete (HTIconNode *icon)
+ {
+     if(icon == NULL)
+          return NO;
+ 
+     if(icon->icon_url)
+     {
+         HT_FREE(icon->icon_url);
+         /* I know kind of a mote point but... */
+         icon->icon_url = NULL;
+     }
+ 
+     if(icon->icon_alt)
+     {
+         HT_FREE(icon->icon_alt);
+         /* I know kind of a mote point but... */
+         icon->icon_alt = NULL;
+     }
+ 
+     if(icon->type_templ)
+     {
+         HT_FREE(icon->type_templ);
+         /* I know kind of a mote point but... */
+         icon->type_templ = NULL;
+     }
+ 
+     HT_FREE(icon);
+ 
+     return YES;
+ }
+ 
+ PUBLIC BOOL HTIcon_deleteAll (void)
+ {
+     /* free icon_unknown and icon_blank which might be the same. */
+     if (icon_unknown == icon_blank)
+         HTIcon_delete(icon_unknown);
+     else{
+         HTIcon_delete(icon_unknown);
+         HTIcon_delete(icon_blank);
+     }
+     HTIcon_delete(icon_parent);
+     HTIcon_delete(icon_dir);
+ 
+     icon_unknown = NULL;
+     icon_blank = NULL;
+     icon_parent = NULL;
+     icon_dir = NULL;
+ 
+     /* Now for the list.... */
+ 
+     if(icons) 
+     {
+ 	    HTList * cur = icons;
+ 	    HTIconNode * node;
+ 
+ 	    while ((node = (HTIconNode*)HTList_nextObject(cur)))
+             HTIcon_delete(node);
+ 
+ 	    HTList_delete(icons);
+     }
+ 
+     icons = NULL;
+ 
+     return YES;
  }
diff -c -r -X excludedfiles libwww/Library/src/HTIcons.h
libwww.AIX.copy/Library/src/HTIcons.h
*** libwww/Library/src/HTIcons.h	Mon Aug  9 16:29:12 1999
--- libwww.AIX.copy/Library/src/HTIcons.h	Tue Feb  8 16:11:11 2000
***************
*** 121,126 ****
--- 121,128 ----
  extern HTIconNode * HTIcon_find (HTFileMode	mode,
  				 HTFormat	content_type,
  				 HTEncoding	content_encoding);
+ extern BOOL HTIcon_delete (HTIconNode *icon);
+ extern BOOL HTIcon_deleteAll (void);
  
  /*
  .
diff -c -r -X excludedfiles libwww/Library/src/HTLib.c
libwww.AIX.copy/Library/src/HTLib.c
*** libwww/Library/src/HTLib.c	Mon Aug  9 10:18:13 1999
--- libwww.AIX.copy/Library/src/HTLib.c	Tue Feb  8 16:11:06 2000
***************
*** 180,205 ****
  */
  PUBLIC BOOL HTLibTerminate (void)
  {
!     HTTRACE(CORE_TRACE, "WWWLibTerm.. Cleaning up LIBRARY OF COMMON
CODE\n");
  
!     HTNet_killAll();
!     HTHost_deleteAll();		/* Delete remaining hosts */
!     HTChannel_deleteAll();			/* Delete remaining channels
*/
  
!     HT_FREE(HTAppName);	        /* Freed thanks to Wade Ogden
<wade@ebt.com> */
!     HT_FREE(HTAppVersion);
  
!     HTAtom_deleteAll();					 /* Remove
the atoms */
!     HTDNS_deleteAll();				/* Remove the DNS
host cache */
!     HTAnchor_deleteAll(NULL);		/* Delete anchors and drop hyperdocs
*/
  
!     HTProtocol_deleteAll();  /* Remove bindings between access and
protocols */
  
!     HTUserProfile_delete(UserProfile);	    /* Free our default User
profile */
  
!     HTUTree_deleteAll();			     /* Delete all URL Trees
*/
  
!     initialized = NO;
      return YES;
  }
  
--- 180,210 ----
  */
  PUBLIC BOOL HTLibTerminate (void)
  {
!     if(initialized == YES)
!     {
!         HTTRACE(CORE_TRACE, "WWWLibTerm.. Cleaning up LIBRARY OF COMMON
CODE\n");
  
!         HTNet_killAll();
!         HTHost_deleteAll();		/* Delete remaining hosts */
!         HTChannel_deleteAll();			/* Delete remaining
channels */
  
!         HT_FREE(HTAppName);	        /* Freed thanks to Wade Ogden
<wade@ebt.com> */
!         HT_FREE(HTAppVersion);
  
!         HTAtom_deleteAll();					 /* Remove
the atoms */
!         HTDNS_deleteAll();				/* Remove the DNS
host cache */
!         HTAnchor_deleteAll(NULL);		/* Delete anchors and drop
hyperdocs */
  
!         HTProtocol_deleteAll();  /* Remove bindings between access and
protocols */
  
!         HTUserProfile_delete(UserProfile);	    /* Free our default User
profile */
!         UserProfile = NULL;
  
!         HTUTree_deleteAll();			     /* Delete all URL Trees
*/
  
!         initialized = NO;
!     }else
!         HTTRACE(CORE_TRACE, "WWWLibTerm.. Not initized. No reason to clean
up LIBRARY OF COMMON CODE\n");
      return YES;
  }
  
diff -c -r -X excludedfiles libwww/Library/src/HTPEP.c
libwww.AIX.copy/Library/src/HTPEP.c
*** libwww/Library/src/HTPEP.c	Mon Aug  9 10:18:16 1999
--- libwww.AIX.copy/Library/src/HTPEP.c	Tue Feb  8 16:11:06 2000
***************
*** 65,73 ****
      /* Find a hash for this PEP module */
      {
  	int hash;
! 	const unsigned char * p;
  	for (p=name, hash=0; *p; p++) {
! 	    hash = (hash * 3 + *p) % HT_M_HASH_SIZE;
  	}
  	if (!HTModules) {
  	    if ((HTModules = (HTList **) HT_CALLOC(HT_M_HASH_SIZE,
--- 65,73 ----
      /* Find a hash for this PEP module */
      {
  	int hash;
! 	const char * p;
  	for (p=name, hash=0; *p; p++) {
! 	    hash = (hash * 3 + (unsigned char)(*p)) % HT_M_HASH_SIZE;
  	}
  	if (!HTModules) {
  	    if ((HTModules = (HTList **) HT_CALLOC(HT_M_HASH_SIZE,
diff -c -r -X excludedfiles libwww/Library/src/HTReq.h
libwww.AIX.copy/Library/src/HTReq.h
*** libwww/Library/src/HTReq.h	Mon Aug  9 16:29:13 1999
--- libwww.AIX.copy/Library/src/HTReq.h	Tue Feb  8 16:16:55 2000
***************
*** 306,311 ****
--- 306,320 ----
  extern BOOL HTRequest_flush (HTRequest * me);
  
  /*
+    There may be conditions where we never want to internal within the
library
+    flush the request.  Some clients cannot handle it.
+    This also makes HTRequest_flush for this request to always return
+    a NO no matter what HTRequest_setFlush has been given.  This is because
+    internally the library uses HTRequest_setFlush to turn on flushes.
+ */
+ extern BOOL HTRequest_setInternalFlush (HTRequest * me, BOOL mode);
+ 
+ /*
  (
    Force the Pipeline to be Flushed Immediately
  )
***************
*** 317,322 ****
--- 326,332 ----
  */
  
  extern int HTRequest_forceFlush (HTRequest * request);
+ 
  
  /*
  .
diff -c -r -X excludedfiles libwww/Library/src/HTReqMan.c
libwww.AIX.copy/Library/src/HTReqMan.c
*** libwww/Library/src/HTReqMan.c	Mon Aug  9 10:18:17 1999
--- libwww.AIX.copy/Library/src/HTReqMan.c	Tue Feb  8 16:16:55 2000
***************
*** 88,93 ****
--- 88,96 ----
      /* Content negotiation */
      me->ContentNegotiation = YES;		       /* Do this by default
*/
  
+     /* Set the default to use internal flushes. */
+     me->internal_flush = YES;
+ 
      HTTRACE(CORE_TRACE, "Request..... Created %p\n" _ me);
  
      return me;
***************
*** 246,251 ****
--- 249,267 ----
  }
  
  /*
+ **  Should we flush internally at any time?
+ */
+ PUBLIC BOOL HTRequest_setInternalFlush (HTRequest * me, BOOL mode)
+ {
+     if (me)
+     {
+         me->internal_flush = mode;
+         return YES;
+     }
+     return NO;
+ }
+ 
+ /*
  **  Should we flush immediately?
  */
  PUBLIC BOOL HTRequest_setFlush (HTRequest * me, BOOL mode)
***************
*** 259,265 ****
  
  PUBLIC BOOL HTRequest_flush (HTRequest * me)
  {
!     return (me ? me->flush : NO);
  }
  
  /*
--- 275,284 ----
  
  PUBLIC BOOL HTRequest_flush (HTRequest * me)
  {
!     if(me->internal_flush == YES)
!         return (me ? me->flush : NO);
!     else
!         return NO;
  }
  
  /*
***************
*** 1592,1598 ****
  PUBLIC int HTRequest_forceFlush (HTRequest * request)
  {
      HTHost * host = HTNet_host(request->net);
!     if (host == NULL) return HT_ERROR;
      return HTHost_forceFlush(host);
  }
  
--- 1611,1629 ----
  PUBLIC int HTRequest_forceFlush (HTRequest * request)
  {
      HTHost * host = HTNet_host(request->net);
!     if (host == NULL)
!         return HT_ERROR;
! 
!     if(request->internal_flush == NO)
!     {
!         /*
!          * Assuming HT_OK is okay.
!          * We want to simulate the flush success.
!          * I couldn't find a user looking at this return value
!         */
!         return HT_OK;
!     }
! 
      return HTHost_forceFlush(host);
  }
  
diff -c -r -X excludedfiles libwww/Library/src/HTReqMan.h
libwww.AIX.copy/Library/src/HTReqMan.h
*** libwww/Library/src/HTReqMan.h	Mon Aug  9 16:29:13 1999
--- libwww.AIX.copy/Library/src/HTReqMan.h	Tue Feb  8 16:16:55 2000
***************
*** 58,63 ****
--- 58,65 ----
  
      BOOL                flush;                /* Should we flush
immediately */
  
+     BOOL            internal_flush;           /* Should we ever do an
internal flush */
+ 
      HTPriority		priority;		/* Priority for this
request */
  
  /*
diff -c -r -X excludedfiles libwww/Library/src/HTTCP.c
libwww.AIX.copy/Library/src/HTTCP.c
*** libwww/Library/src/HTTCP.c	Mon Aug  9 10:18:18 1999
--- libwww.AIX.copy/Library/src/HTTCP.c	Tue Feb  8 16:11:08 2000
***************
*** 423,429 ****
  {
      HTHost * host = HTNet_host(listening);
      HTRequest * request = HTNet_request(accepting);
!     int size = sizeof(host->sock_addr);
      int status;
      if (!request || HTNet_socket(listening)==INVSOC) {
  	HTTRACE(PROT_TRACE, "HTDoAccept.. Invalid socket\n");
--- 423,429 ----
  {
      HTHost * host = HTNet_host(listening);
      HTRequest * request = HTNet_request(accepting);
!     unsigned long size = sizeof(host->sock_addr);
      int status;
      if (!request || HTNet_socket(listening)==INVSOC) {
  	HTTRACE(PROT_TRACE, "HTDoAccept.. Invalid socket\n");
diff -c -r -X excludedfiles libwww/Library/src/HTUTree.c
libwww.AIX.copy/Library/src/HTUTree.c
*** libwww/Library/src/HTUTree.c	Mon Aug  9 10:18:20 1999
--- libwww.AIX.copy/Library/src/HTUTree.c	Tue Feb  8 16:11:09 2000
***************
*** 290,298 ****
      /* Find a hash for this host */
      {
  	int hash;
! 	const unsigned char * p;
  	for (p=host, hash=0; *p; p++) {
! 	    hash = (hash * 3 + *p) % HT_L_HASH_SIZE;
  	}
  	if (!InfoTable) {
  	    if ((InfoTable = (HTList **) HT_CALLOC(HT_L_HASH_SIZE,
--- 290,298 ----
      /* Find a hash for this host */
      {
  	int hash;
! 	const char * p;
  	for (p=host, hash=0; *p; p++) {
! 	    hash = (hash * 3 + (unsigned char)(*p)) % HT_L_HASH_SIZE;
  	}
  	if (!InfoTable) {
  	    if ((InfoTable = (HTList **) HT_CALLOC(HT_L_HASH_SIZE,
diff -c -r -X excludedfiles libwww/Library/src/HTUtils.h
libwww.AIX.copy/Library/src/HTUtils.h
*** libwww/Library/src/HTUtils.h	Tue Aug 10 11:05:47 1999
--- libwww.AIX.copy/Library/src/HTUtils.h	Tue Feb  8 16:11:12 2000
***************
*** 132,138 ****
      SHOW_SQL_TRACE      = 0x8000,
      SHOW_XML_TRACE      = 0x10000,
      SHOW_ALL_TRACE	= 0xFFFFFFF
-     /* SHOW_ALL_TRACE	= 0xFFFFFFFF */
  } HTTraceFlags;
  
  /*
--- 132,137 ----
diff -c -r -X excludedfiles libwww/Library/src/SGML.c
libwww.AIX.copy/Library/src/SGML.c
*** libwww/Library/src/SGML.c	Tue Aug 10 10:45:57 1999
--- libwww.AIX.copy/Library/src/SGML.c	Tue Feb  8 16:11:10 2000
***************
*** 80,86 ****
  
  	int high, low, i, diff;		/* Binary search for attribute name
*/
  
! /*	assert(tag->number_of_attributes <= MAX_ATTRIBUTES); */
  
  	for(low=0, high=tag->number_of_attributes;
  	    high > low ;
--- 80,86 ----
  
  	int high, low, i, diff;		/* Binary search for attribute name
*/
  
! 	assert(tag->number_of_attributes <= MAX_ATTRIBUTES);
  
  	for(low=0, high=tag->number_of_attributes;
  	    high > low ;
diff -c -r -X excludedfiles libwww/PICS-client/src/CSParse.c
libwww.AIX.copy/PICS-client/src/CSParse.c
*** libwww/PICS-client/src/CSParse.c	Mon Aug  9 10:18:43 1999
--- libwww.AIX.copy/PICS-client/src/CSParse.c	Tue Feb  8 16:11:20 2000
***************
*** 368,374 ****
  				    char demark, StateRet_t errorCode)
  {
      char * token = HTChunk_data(pCSParse->token);
!     pCSParse->pParseContext->pTokenError = errorLocation;
      return (*pCSParse->pParseContext->pParseErrorHandler)(pCSParse, token,

  					      demark,
StateRet_ERROR_BAD_CHAR);
  }
--- 368,375 ----
  				    char demark, StateRet_t errorCode)
  {
      char * token = HTChunk_data(pCSParse->token);
!     /* Ohhhh.  Casting away a const. */
!     pCSParse->pParseContext->pTokenError = (char *)errorLocation;
      return (*pCSParse->pParseContext->pParseErrorHandler)(pCSParse, token,

  					      demark,
StateRet_ERROR_BAD_CHAR);
  }
-------------------------------Cut here--------------------------------
-------------------------------Tis the end!----------------------------
-----Want a new monitor?  Drive nail here 0!---------------------------

-----Original Message-----
From: Sam Couter [mailto:sam@topic.com.au]
Sent: Wednesday, February 16, 2000 6:24 PM
To: Desrochers, Gary
Cc: 'www-lib@w3.org'
Subject: Re: How to submit.


Desrochers, Gary <Gary.Desrochers@fmr.com> wrote:
> As I have said in previous mails, what is the proper way to submit
patches.

If you mail them to the list, the people with write access to the CVS
repository will be able to look them over and commit them, or ask you about
what the patches do, etc.

> (There must not be many people on this mailing list?)

Only a handful of active posters, but I suspect quite a few lurkers.
-- 
Sam Couter                                              sam@topic.com.au
Internet Engineer                               http://www.topic.com.au/
tSA Consulting

Received on Thursday, 17 February 2000 08:26:28 UTC