]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
fetcher: Add option to retrieve response code from a fetcher
authorTobias Brunner <tobias@strongswan.org>
Wed, 7 May 2014 14:59:07 +0000 (16:59 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 19 May 2014 12:20:50 +0000 (14:20 +0200)
src/libstrongswan/fetcher/fetcher.h
src/libstrongswan/fetcher/fetcher_manager.c

index 890258c3caa19d108302dc80e1765c83014e09a8..6043dac2edfea73c126049e228020d1c30a44363 100644 (file)
@@ -81,6 +81,12 @@ enum fetcher_option_t {
         */
        FETCH_TIMEOUT,
 
+       /**
+        * Sets a pointer to a variable that receives the request's response code.
+        * Additional argument is a u_int*.
+        */
+       FETCH_RESPONSE_CODE,
+
        /**
         * Callback to invoke with each chunk of data.
         * Additional argument fetch_callback_t.
index 2fad486e06e6042fcc8efd3173b7972ac88d03fc..f36cfcf8240ebe8bb55e923d1e943441f2fc5e46 100644 (file)
@@ -113,6 +113,10 @@ METHOD(fetcher_manager_t, fetch, status_t,
                                        good = fetcher->set_option(fetcher, opt,
                                                                                        va_arg(args, fetcher_callback_t));
                                        continue;
+                               case FETCH_RESPONSE_CODE:
+                                       good = fetcher->set_option(fetcher, opt,
+                                                                                       va_arg(args, u_int*));
+                                       continue;
                                case FETCH_SOURCEIP:
                                        host = va_arg(args, host_t*);
                                        if (host && !host->is_anyaddr(host))