- client: add <force_ntlm> config flag.

Causes client to use NTLM auth and HTTP 1.0
- client: we weren't doing exponential backoff if scheduler
    requests failed at initialization; fix this

svn path=/trunk/boinc/; revision=14628
This commit is contained in:
David Anderson 2008-01-28 16:52:52 +00:00
parent 2b7314c574
commit 9c89b45af2
5 changed files with 48 additions and 29 deletions

View File

@ -811,3 +811,14 @@ David Jan 28 2008
user.inc
user/
login_action.php
David Jan 28 2008
- client: add <force_ntlm> config flag.
Causes client to use NTLM auth and HTTP 1.0
- client: we weren't doing exponential backoff if scheduler
requests failed at initialization; fix this
client/
http_curl.C
log_flags.C,h
scheduler_op.C

View File

@ -398,7 +398,7 @@ int HTTP_OP::libcurl_exec(
// force curl to use HTTP/1.0 if config specifies it
// (curl uses 1.1 by default)
//
if (config.http_1_0) {
if (config.http_1_0 || config.force_ntlm) {
curlErr = curl_easy_setopt(curlEasy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
}
curlErr = curl_easy_setopt(curlEasy, CURLOPT_MAXREDIRS, 50L);
@ -770,32 +770,29 @@ int libcurl_debugfunction(
void HTTP_OP::setupProxyCurl() {
// CMC: use the libcurl proxy routines with this object's proxy information struct
/* PROXY_INFO pi useful members:
pi.http_server_name
pi.http_server_port
pi.http_user_name
pi.http_user_passwd
pi.socks5_user_name
pi.socks5_user_passwd
pi.socks_server_name
pi.socks_server_port
pi.socks_version
pi.use_http_auth
pi.use_http_proxy
pi.use_socks_proxy
Curl self-explanatory setopt params for proxies:
CURLOPT_HTTPPROXYTUNNEL
CURLOPT_PROXYTYPE (pass in CURLPROXY_HTTP or CURLPROXY_SOCKS5)
CURLOPT_PROXYPORT -- a long port #
CURLOPT_PROXY - pass in char* of the proxy url
CURLOPT_PROXYUSERPWD -- a char* in the format username:password
CURLOPT_HTTPAUTH -- pass in one of CURLAUTH_BASIC, CURLAUTH_DIGEST,
CURLAUTH_GSSNEGOTIATE, CURLAUTH_NTLM, CURLAUTH_ANY, CURLAUTH_ANYSAFE
CURLOPT_PROXYAUTH -- "or" | the above bitmasks -- only basic, digest, ntlm work
*/
// PROXY_INFO pi useful members:
// pi.http_server_name
// pi.http_server_port
// pi.http_user_name
// pi.http_user_passwd
// pi.socks5_user_name
// pi.socks5_user_passwd
// pi.socks_server_name
// pi.socks_server_port
// pi.socks_version
// pi.use_http_auth
// pi.use_http_proxy
// pi.use_socks_proxy
//
// Curl self-explanatory setopt params for proxies:
// CURLOPT_HTTPPROXYTUNNEL
// CURLOPT_PROXYTYPE (pass in CURLPROXY_HTTP or CURLPROXY_SOCKS5)
// CURLOPT_PROXYPORT -- a long port #
// CURLOPT_PROXY - pass in char* of the proxy url
// CURLOPT_PROXYUSERPWD -- a char* in the format username:password
// CURLOPT_HTTPAUTH -- pass in one of CURLAUTH_BASIC, CURLAUTH_DIGEST,
// CURLAUTH_GSSNEGOTIATE, CURLAUTH_NTLM, CURLAUTH_ANY, CURLAUTH_ANYSAFE
// CURLOPT_PROXYAUTH -- "or" | the above bitmasks -- only basic, digest, ntlm work
CURLcode curlErr;
@ -815,7 +812,11 @@ void HTTP_OP::setupProxyCurl() {
if (auth_type) {
curlErr = curl_easy_setopt(curlEasy, CURLOPT_PROXYAUTH, auth_type);
} else {
curlErr = curl_easy_setopt(curlEasy, CURLOPT_PROXYAUTH, CURLAUTH_ANY & ~CURLAUTH_NTLM);
if (config.force_ntlm) {
curlErr = curl_easy_setopt(curlEasy, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
} else {
curlErr = curl_easy_setopt(curlEasy, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
}
}
sprintf(szCurlProxyUserPwd, "%s:%s", pi.http_user_name, pi.http_user_passwd);
curlErr = curl_easy_setopt(curlEasy, CURLOPT_PROXYUSERPWD, szCurlProxyUserPwd);
@ -991,9 +992,11 @@ void HTTP_OP_SET::got_select(FDSET_GROUP&, double timeout) {
// if proxy/socks server uses authentication and its not set yet,
// get what last transfer used
//
if (hop->auth_flag && !hop->auth_type) {
curlErr = curl_easy_getinfo(hop->curlEasy,
CURLINFO_PROXYAUTH_AVAIL, &hop->auth_type);
CURLINFO_PROXYAUTH_AVAIL, &hop->auth_type
);
}
// the op is done if curl_multi_msg_read gave us a msg for this http_op

View File

@ -206,6 +206,7 @@ void CONFIG::defaults() {
report_results_immediately = false;
start_delay = 0;
run_apps_manually = false;
force_ntlm = false;
}
int CONFIG::parse_options(XML_PARSER& xp) {
@ -251,6 +252,7 @@ int CONFIG::parse_options(XML_PARSER& xp) {
if (xp.parse_bool(tag, "report_results_immediately", report_results_immediately)) continue;
if (xp.parse_double(tag, "start_delay", start_delay)) continue;
if (xp.parse_bool(tag, "run_apps_manually", run_apps_manually)) continue;
if (xp.parse_bool(tag, "force_ntlm", force_ntlm)) continue;
msg_printf(NULL, MSG_USER_ERROR, "Unrecognized tag in %s: <%s>\n",
CONFIG_FILE, tag
);

View File

@ -103,6 +103,7 @@ struct CONFIG {
bool report_results_immediately;
double start_delay;
bool run_apps_manually;
bool force_ntlm;
CONFIG();
void defaults();

View File

@ -234,6 +234,7 @@ int SCHEDULER_OP::start_rpc(PROJECT* p) {
"Scheduler request failed: %s", boincerror(retval)
);
}
backoff(cur_proj, "scheduler request failed");
return retval;
}
retval = http_ops->insert(&http_op);
@ -243,6 +244,7 @@ int SCHEDULER_OP::start_rpc(PROJECT* p) {
"Scheduler request failed: %s", boincerror(retval)
);
}
backoff(cur_proj, "scheduler request failed");
return retval;
}
p->rpc_seqno++;