+ int parse_success = 0;
+ XML_Parser xp = XML_ParserCreateNS(NULL, '|');
+ if (xp) {
+ // XML_SetUserData(xp, XXX);
+ XML_SetElementHandler(xp, propfind_xml_start, propfind_xml_end);
+ // XML_SetCharacterDataHandler(xp, xrds_xml_chardata);
+
+ const char *req = ChrPtr(WCC->upload);
+ if (req) {
+ req = strchr(req, '<'); /* hunt for the first tag */
+ }
+ if (!req) {
+ req = "ERROR"; /* force it to barf */
+ }
+
+ i = XML_Parse(xp, req, strlen(req), 1);
+ if (!i) {
+ syslog(LOG_DEBUG, "XML_Parse() failed: %s", XML_ErrorString(XML_GetErrorCode(xp)));
+ XML_ParserFree(xp);
+ parse_success = 0;
+ }
+ else {
+ parse_success = 1;
+ }
+ }
+
+ if (!parse_success) {
+ hprintf("HTTP/1.1 500 Internal Server Error\r\n");
+ dav_common_headers();
+ hprintf("Date: %s\r\n", datestring);
+ hprintf("Content-Type: text/plain\r\n");
+ wc_printf("An internal error has occurred at %s:%d.\r\n", __FILE__ , __LINE__ );
+ end_burst();
+ return;
+ }
+