version 1.8, 2000/09/16 19:45:06
|
version 1.9, 2000/10/25 19:26:53
|
Line 38
|
Line 38
|
#include <libxml/nanohttp.h> |
#include <libxml/nanohttp.h> |
#include <libxml/tree.h> |
#include <libxml/tree.h> |
#include <libxml/parser.h> |
#include <libxml/parser.h> |
|
#include <libxml/xmlerror.h> |
|
|
static int debug = 0; |
static int debug = 0; |
|
|
Line 141 void nodeinfoListFree(nodeinfoPtr info)
|
Line 142 void nodeinfoListFree(nodeinfoPtr info)
|
} |
} |
void nodeinfoPrint(nodeinfoPtr info) { |
void nodeinfoPrint(nodeinfoPtr info) { |
if (info == NULL) return; |
if (info == NULL) return; |
if (info->date) printf("%s\t", info->date); |
if (info->date) xmlGenericError(xmlGenericErrorContext, |
if (info->name) printf("%s\t", info->name); |
"%s\t", info->date); |
else printf("???\t"); |
if (info->name) xmlGenericError(xmlGenericErrorContext, |
if (info->size) printf("%s\t", info->size); |
"%s\t", info->name); |
if (info->content) printf("%s\t", info->content); |
else xmlGenericError(xmlGenericErrorContext, |
printf("\n"); |
"???\t"); |
|
if (info->size) xmlGenericError(xmlGenericErrorContext, |
|
"%s\t", info->size); |
|
if (info->content) xmlGenericError(xmlGenericErrorContext, |
|
"%s\t", info->content); |
|
xmlGenericError(xmlGenericErrorContext, "\n"); |
} |
} |
void nodeinfoListPrint(nodeinfoPtr info) { |
void nodeinfoListPrint(nodeinfoPtr info) { |
nodeinfoPtr cur = info; |
nodeinfoPtr cur = info; |
Line 180 int propfindQuery(const char *URL, char
|
Line 186 int propfindQuery(const char *URL, char
|
ctxt = xmlNanoHTTPMethod(URL, "PROPFIND", verboseQuery, |
ctxt = xmlNanoHTTPMethod(URL, "PROPFIND", verboseQuery, |
&contentType, "Depth: 0\r\n"); |
&contentType, "Depth: 0\r\n"); |
if (ctxt == NULL) { |
if (ctxt == NULL) { |
fprintf(stderr, "PROPFIND %s failed\n", URL); |
xmlGenericError(xmlGenericErrorContext, |
|
"PROPFIND %s failed\n", URL); |
return(-1); |
return(-1); |
} |
} |
|
|
Line 195 int propfindQuery(const char *URL, char
|
Line 202 int propfindQuery(const char *URL, char
|
|
|
output = (char *) xmlMalloc(size + 1); |
output = (char *) xmlMalloc(size + 1); |
if (output == NULL) { |
if (output == NULL) { |
fprintf(stderr, "out of memory\n"); |
xmlGenericError(xmlGenericErrorContext, |
|
"out of memory\n"); |
xmlNanoHTTPClose(ctxt); |
xmlNanoHTTPClose(ctxt); |
return(-1); |
return(-1); |
} |
} |
len = xmlNanoHTTPRead(ctxt, output, size); |
len = xmlNanoHTTPRead(ctxt, output, size); |
if (len < 0) { |
if (len < 0) { |
fprintf(stderr, "cannot read PROPFIND %s result\n", URL); |
xmlGenericError(xmlGenericErrorContext, |
|
"cannot read PROPFIND %s result\n", URL); |
xmlNanoHTTPClose(ctxt); |
xmlNanoHTTPClose(ctxt); |
xmlFree(output); |
xmlFree(output); |
return(-1); |
return(-1); |
Line 410 int main(int argc, char** argv) {
|
Line 419 int main(int argc, char** argv) {
|
#else /* !LIBXML_HTTP_ENABLED */ |
#else /* !LIBXML_HTTP_ENABLED */ |
#include <stdio.h> |
#include <stdio.h> |
int main(int argc, char **argv) { |
int main(int argc, char **argv) { |
printf("%s : HTTP support not compiled in\n", argv[0]); |
xmlGenericError(xmlGenericErrorContext, |
|
"%s : HTTP support not compiled in\n", argv[0]); |
return(0); |
return(0); |
} |
} |
#endif /* LIBXML_HTTP_ENABLED */ |
#endif /* LIBXML_HTTP_ENABLED */ |