- nanohttp.c: added xmlNanoHTTPTimeout(int delay), removed a bug

xmlNanoHTTPMethod on input MimeType Tony Lam <Tony.Lam@eng.sun.com>
- xpointer.c: slight extension of xmlXPtrLocationSetMerge
Daniel
This commit is contained in:
Daniel Veillard 2000-10-11 23:50:35 +00:00
parent b0426caeb9
commit 19d6111574
3 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,9 @@
Thu Oct 12 01:44:08 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* nanohttp.c: added xmlNanoHTTPTimeout(int delay), removed a bug
xmlNanoHTTPMethod on input MimeType Tony Lam <Tony.Lam@eng.sun.com>
* xpointer.c: slight extension of xmlXPtrLocationSetMerge
Thu Oct 12 01:37:53 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* config.h.in configure.in nanoftp.c nanohttp.c xmlversion.h.in :

View File

@ -101,8 +101,9 @@ typedef struct xmlNanoHTTPCtxt {
} xmlNanoHTTPCtxt, *xmlNanoHTTPCtxtPtr;
static int initialized = 0;
static char *proxy = NULL; /* the proxy name if any */
static char *proxy = NULL; /* the proxy name if any */
static int proxyPort; /* the proxy port if any */
static unsigned int timeout = 60;/* the select() timeout in seconds */
/**
* A bit of portability macros and functions
@ -181,6 +182,19 @@ xmlNanoHTTPCleanup(void) {
return;
}
/**
* xmlNanoHTTPTimeout:
* @delay: the delay in seconds
*
* Set the HTTP timeout, (default is 60secs). 0 means immediate
* return, while -1 infinite.
*/
void
xmlNanoHTTPTimeout(int delay) {
timeout = (unsigned int) delay;
}
/**
* xmlNanoHTTPScanURL:
* @ctxt: an HTTP context
@ -462,7 +476,7 @@ xmlNanoHTTPRecv(xmlNanoHTTPCtxtPtr ctxt) {
}
}
tv.tv_sec = 10;
tv.tv_sec = timeout;
tv.tv_usec = 0;
FD_ZERO(&rfd);
FD_SET(ctxt->fd, &rfd);
@ -656,7 +670,7 @@ xmlNanoHTTPConnectAttempt(struct in_addr ia, int port)
return(-1);
}
tv.tv_sec = 60; /* We use 60 second timeouts for now */
tv.tv_sec = timeout;
tv.tv_usec = 0;
FD_ZERO(&wfd);
@ -968,7 +982,6 @@ xmlNanoHTTPMethod(const char *URL, const char *method, const char *input,
if (URL == NULL) return(NULL);
if (method == NULL) method = "GET";
if (contentType != NULL) *contentType = NULL;
retry:
if (redirURL == NULL)

View File

@ -381,10 +381,11 @@ xmlXPtrLocationSetAdd(xmlLocationSetPtr cur, xmlXPathObjectPtr val) {
/**
* xmlXPtrLocationSetMerge:
* @val1: the first LocationSet
* @val1: the first LocationSet or NULL
* @val2: the second LocationSet
*
* Merges two rangesets, all ranges from @val2 are added to @val1
* if @val1 is NULL, a new set is created and copied from @val2
*
* Returns val1 once extended or NULL in case of error.
*/
@ -392,8 +393,12 @@ xmlLocationSetPtr
xmlXPtrLocationSetMerge(xmlLocationSetPtr val1, xmlLocationSetPtr val2) {
int i;
if (val1 == NULL) return(NULL);
if (val2 == NULL) return(val1);
if (val1 == NULL) {
val1 = xmlXPtrLocationSetCreate(NULL);
if (val1 == NULL)
return(NULL);
}
/*
* !!!!! this can be optimized a lot, knowing that both