From: David Woodhouse Date: Thu, 22 Jul 2010 16:00:09 +0000 (+0100) Subject: Handle recursion X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=16d65c2bda07e70bf8a8960b73cedeab695868bc;p=users%2Fdwmw2%2Fews-sync.git Handle recursion --- diff --git a/ews_syncfolder.c b/ews_syncfolder.c index 6ce4324..b359ecc 100644 --- a/ews_syncfolder.c +++ b/ews_syncfolder.c @@ -274,10 +274,26 @@ int main(int argc, char **argv) return 0; } +struct _state { + SoupSession *sess; + char *url; +}; + +icalcomponent *fetch_xml_subitem(void *_st, const char *itemid, + const char *parent_id, icaltimezone *parent_zone, GError **error) +{ + struct _state *st = _st; + return fetch_xml_item(st->sess, st->url, itemid, NULL, parent_id, parent_zone, error); +} + icalcomponent *fetch_xml_item(SoupSession *sess, char *url, const char *itemid, const char *xml_filename, const char *parent_id, icaltimezone *parent_zone, GError **error) { + struct _state st = { + .sess = sess, + .url = url, + }; SoupSoapMessage *msg; SoupSoapResponse *resp; xmlNode *node; @@ -391,7 +407,7 @@ icalcomponent *fetch_xml_item(SoupSession *sess, char *url, const char *itemid, goto out; } - calcomp = ews_calitem_to_ical(node, parent_id, parent_zone, NULL, NULL, error); + calcomp = ews_calitem_to_ical(node, parent_id, parent_zone, fetch_xml_subitem, (void *)&st, error); out: g_object_unref(resp);