diff options
Diffstat (limited to 'src/curl/curl_reschedule.c')
-rw-r--r-- | src/curl/curl_reschedule.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/curl/curl_reschedule.c b/src/curl/curl_reschedule.c index 0b5b85687..cc3c1db95 100644 --- a/src/curl/curl_reschedule.c +++ b/src/curl/curl_reschedule.c | |||
@@ -77,6 +77,18 @@ GNUNET_CURL_gnunet_rc_create_with_parser (struct GNUNET_CURL_Context *ctx, | |||
77 | return rctx; | 77 | return rctx; |
78 | } | 78 | } |
79 | 79 | ||
80 | |||
81 | /** | ||
82 | * Just a wrapper to avoid casting of function pointers. | ||
83 | * | ||
84 | * @param response the (JSON) response to clean. | ||
85 | */ | ||
86 | static void | ||
87 | clean_result (void *response) | ||
88 | { | ||
89 | json_decref (response); | ||
90 | } | ||
91 | |||
80 | /** | 92 | /** |
81 | * Initialize reschedule context. | 93 | * Initialize reschedule context. |
82 | * | 94 | * |
@@ -90,8 +102,8 @@ GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context *ctx) | |||
90 | 102 | ||
91 | rc = GNUNET_new (struct GNUNET_CURL_RescheduleContext); | 103 | rc = GNUNET_new (struct GNUNET_CURL_RescheduleContext); |
92 | rc->ctx = ctx; | 104 | rc->ctx = ctx; |
93 | rc->parser = (GNUNET_CURL_RawParser) &download_get_result; | 105 | rc->parser = &download_get_result; |
94 | rc->cleaner = (GNUNET_CURL_ResponseCleaner) &json_decref; | 106 | rc->cleaner = &clean_result; |
95 | return rc; | 107 | return rc; |
96 | } | 108 | } |
97 | 109 | ||