mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
- 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:
@ -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>
|
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 :
|
* config.h.in configure.in nanoftp.c nanohttp.c xmlversion.h.in :
|
||||||
|
21
nanohttp.c
21
nanohttp.c
@ -101,8 +101,9 @@ typedef struct xmlNanoHTTPCtxt {
|
|||||||
} xmlNanoHTTPCtxt, *xmlNanoHTTPCtxtPtr;
|
} xmlNanoHTTPCtxt, *xmlNanoHTTPCtxtPtr;
|
||||||
|
|
||||||
static int initialized = 0;
|
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 int proxyPort; /* the proxy port if any */
|
||||||
|
static unsigned int timeout = 60;/* the select() timeout in seconds */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A bit of portability macros and functions
|
* A bit of portability macros and functions
|
||||||
@ -181,6 +182,19 @@ xmlNanoHTTPCleanup(void) {
|
|||||||
return;
|
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:
|
* xmlNanoHTTPScanURL:
|
||||||
* @ctxt: an HTTP context
|
* @ctxt: an HTTP context
|
||||||
@ -462,7 +476,7 @@ xmlNanoHTTPRecv(xmlNanoHTTPCtxtPtr ctxt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tv.tv_sec = 10;
|
tv.tv_sec = timeout;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
FD_ZERO(&rfd);
|
FD_ZERO(&rfd);
|
||||||
FD_SET(ctxt->fd, &rfd);
|
FD_SET(ctxt->fd, &rfd);
|
||||||
@ -656,7 +670,7 @@ xmlNanoHTTPConnectAttempt(struct in_addr ia, int port)
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
tv.tv_sec = 60; /* We use 60 second timeouts for now */
|
tv.tv_sec = timeout;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
FD_ZERO(&wfd);
|
FD_ZERO(&wfd);
|
||||||
@ -968,7 +982,6 @@ xmlNanoHTTPMethod(const char *URL, const char *method, const char *input,
|
|||||||
|
|
||||||
if (URL == NULL) return(NULL);
|
if (URL == NULL) return(NULL);
|
||||||
if (method == NULL) method = "GET";
|
if (method == NULL) method = "GET";
|
||||||
if (contentType != NULL) *contentType = NULL;
|
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
if (redirURL == NULL)
|
if (redirURL == NULL)
|
||||||
|
@ -381,10 +381,11 @@ xmlXPtrLocationSetAdd(xmlLocationSetPtr cur, xmlXPathObjectPtr val) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlXPtrLocationSetMerge:
|
* xmlXPtrLocationSetMerge:
|
||||||
* @val1: the first LocationSet
|
* @val1: the first LocationSet or NULL
|
||||||
* @val2: the second LocationSet
|
* @val2: the second LocationSet
|
||||||
*
|
*
|
||||||
* Merges two rangesets, all ranges from @val2 are added to @val1
|
* 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.
|
* Returns val1 once extended or NULL in case of error.
|
||||||
*/
|
*/
|
||||||
@ -392,8 +393,12 @@ xmlLocationSetPtr
|
|||||||
xmlXPtrLocationSetMerge(xmlLocationSetPtr val1, xmlLocationSetPtr val2) {
|
xmlXPtrLocationSetMerge(xmlLocationSetPtr val1, xmlLocationSetPtr val2) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (val1 == NULL) return(NULL);
|
|
||||||
if (val2 == NULL) return(val1);
|
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
|
* !!!!! this can be optimized a lot, knowing that both
|
||||||
|
Reference in New Issue
Block a user