fetcher: Add option to retrieve response code from a fetcher
This commit is contained in:
@@ -81,6 +81,12 @@ enum fetcher_option_t {
|
|||||||
*/
|
*/
|
||||||
FETCH_TIMEOUT,
|
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.
|
* Callback to invoke with each chunk of data.
|
||||||
* Additional argument fetch_callback_t.
|
* Additional argument fetch_callback_t.
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ METHOD(fetcher_manager_t, fetch, status_t,
|
|||||||
good = fetcher->set_option(fetcher, opt,
|
good = fetcher->set_option(fetcher, opt,
|
||||||
va_arg(args, fetcher_callback_t));
|
va_arg(args, fetcher_callback_t));
|
||||||
continue;
|
continue;
|
||||||
|
case FETCH_RESPONSE_CODE:
|
||||||
|
good = fetcher->set_option(fetcher, opt,
|
||||||
|
va_arg(args, u_int*));
|
||||||
|
continue;
|
||||||
case FETCH_SOURCEIP:
|
case FETCH_SOURCEIP:
|
||||||
host = va_arg(args, host_t*);
|
host = va_arg(args, host_t*);
|
||||||
if (host && !host->is_anyaddr(host))
|
if (host && !host->is_anyaddr(host))
|
||||||
|
|||||||
Reference in New Issue
Block a user