diff options
Diffstat (limited to 'src/libstrongswan/fetcher')
-rw-r--r-- | src/libstrongswan/fetcher/fetcher.h | 6 | ||||
-rw-r--r-- | src/libstrongswan/fetcher/fetcher_manager.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/libstrongswan/fetcher/fetcher.h b/src/libstrongswan/fetcher/fetcher.h index 890258c3c..6043dac2e 100644 --- a/src/libstrongswan/fetcher/fetcher.h +++ b/src/libstrongswan/fetcher/fetcher.h @@ -82,6 +82,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. * If this option is not given, the fetcher_default_callback is used, diff --git a/src/libstrongswan/fetcher/fetcher_manager.c b/src/libstrongswan/fetcher/fetcher_manager.c index 2fad486e0..f36cfcf82 100644 --- a/src/libstrongswan/fetcher/fetcher_manager.c +++ b/src/libstrongswan/fetcher/fetcher_manager.c @@ -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)) |