]> www.infradead.org Git - users/dwmw2/ews-sync.git/commitdiff
Don't abort sync run for a single fetch failure
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 21 Jul 2010 00:07:39 +0000 (01:07 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 21 Jul 2010 00:07:39 +0000 (01:07 +0100)
ews_syncfolder.c

index 7e99d3179dea67f089f51c263182162cb863dd5e..46bf8312a76c4b8c26814425f5a6d5969cbb33b4 100644 (file)
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
                                         (xmlChar *)syncstate);
 
        child = xmlNewTextChild (node, messages_ns, (xmlChar *)"MaxChangesReturned",
-                                (xmlChar *)"5");
+                                (xmlChar *)"50");
 
        buf = xmlAllocOutputBuffer(NULL);
        xmlNodeDumpOutput(buf, doc, xmlDocGetRootElement(doc), 0, 1, NULL);
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
        doc = xmlReadMemory (msg->response_body->data, msg->response_body->length,
                             "syncresponse.xml", NULL, 0);
        if (!doc) {
-               fprintf(stderr, "Failed to parse autodiscover response XML\n");
+               fprintf(stderr, "Failed to parse SyncFolderItems response XML\n");
                exit(1);
        }
        node = xmlDocGetRootElement(doc);
@@ -244,6 +244,7 @@ int main(int argc, char **argv)
        g_file_set_contents(statefilename, syncstate, strlen(syncstate), NULL);
        return 0;
 }
+
 int fetch_xml_item(SoupSession *sess, char *url, const char *itemid,
                   const char *xml_filename, const char *ics_filename)
 {
@@ -308,7 +309,7 @@ int fetch_xml_item(SoupSession *sess, char *url, const char *itemid,
        doc = xmlReadMemory (msg->response_body->data, msg->response_body->length,
                             "syncresponse.xml", NULL, 0);
        if (!doc) {
-               fprintf(stderr, "Failed to parse autodiscover response XML\n");
+               fprintf(stderr, "Failed to parse GetItem response XML\n");
                exit(1);
        }
        node = xmlDocGetRootElement(doc);
@@ -361,7 +362,9 @@ int fetch_xml_item(SoupSession *sess, char *url, const char *itemid,
                                        xmlNodeGetContent(node));
                        }
                }
-               exit(1);
+               /* Don't abort the whole sync run just for this */
+               xmlFreeDoc(doc);
+               return 0;
        } else if (strcmp(responseclass, "Success")) {
                fprintf(stderr, "Unknown response class '%s' from server\n",
                        responseclass);
@@ -392,7 +395,7 @@ int fetch_xml_item(SoupSession *sess, char *url, const char *itemid,
        if (!calcomp) {
                printf("Failed to parse calendar: %s\n", error->message);
                g_clear_error(&error);
-               return -1;
+               return 0;
        }
        outbuf = icalcomponent_as_ical_string_r(calcomp);