curl: add an option to fetch bound to a local source address

This commit is contained in:
Martin Willi
2013-06-11 15:54:26 +02:00
parent 0adfffb6dd
commit fe20f752f1
3 changed files with 23 additions and 0 deletions
@@ -177,6 +177,15 @@ METHOD(fetcher_t, set_option, bool,
this->cb = va_arg(args, fetcher_callback_t);
break;
}
case FETCH_SOURCEIP:
{
char buf[64];
snprintf(buf, sizeof(buf), "%H", va_arg(args, host_t*));
supported = curl_easy_setopt(this->curl, CURLOPT_INTERFACE,
buf) == CURLE_OK;
break;
}
default:
supported = FALSE;
break;