curl-library
server blacklisting not working with multi interface
Date: Thu, 5 Feb 2015 13:26:06 +0100
Hello all,
Having issues in the following c++ code with performing a simple HTTP GET
with multi interface and server blacklisting.
code listing
CURLM *curlm;
int handle_count;
curlm = curl_multi_init();
CURL *curl1 = NULL;
curl1 = curl_easy_init();
CURL *curl2 = NULL;
curl2 = curl_easy_init();
curl_multi_setopt(curlm, CURLMOPT_PIPELINING, 1L);
char* server_blacklist[] =
{
"Server1",
NULL
};
curl_multi_setopt(curlm, CURLMOPT_PIPELINING_SERVER_BL,
server_blacklist);
char* site_blacklist[] =
{
"localhost",
NULL
};
curl_multi_setopt(curlm, CURLMOPT_PIPELINING_SITE_BL, site_blacklist);
if(curl1 && curl2)
{
curl_easy_setopt(curl1, CURLOPT_USERNAME, "admin");
curl_easy_setopt(curl1, CURLOPT_USERNAME, "admin");
curl_easy_setopt(curl1, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl1, CURLOPT_USERAGENT, "curl/7.19.6
(i386-pc-win32) libcurl/7.19.6 OpenSSL/0.9.8k");
curl_easy_setopt(curl1, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_easy_setopt(curl1, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl1, CURLOPT_URL, "http://localhost:8002/manage/v2
");
curl_easy_setopt(curl1, CURLOPT_HTTPGET, 1L);
curl_easy_setopt(curl1, CURLOPT_NOPROGRESS, 1L);
curl_multi_add_handle(curlm, curl1);
//curl_easy_setopt(curl2, CURLOPT_URL, "http://google.com/");
//curl_multi_add_handle(curlm, curl2);
CURLMcode code;
while(1)
{
code = curl_multi_perform(curlm, &handle_count);
if(handle_count == 0)
{
break;
}
}
}
curl_global_cleanup();
this results in 'Server1 is not blacklisted'
< HTTP/1.1 401 Unauthorized
* Server Server1 is not blacklisted
< Server: Server1
< WWW-Authenticate: Digest realm="public", qop="auth", nonce="
0728bb231f45a2993ce26ca6bc992693", opaque="fc0a070ba7713fe2"
< Content-Type: text/html; charset=utf-8
< Content-Length: 209
< Connection: Keep-Alive
< Keep-Alive: timeout=5
<
* Ignoring the response-body
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'http://localhost:8002/manage/v2'
and subsequent http request also being blacklisted
< HTTP/1.1 401 Unauthorized
* Server MarkLogic is not blacklisted
< Server: MarkLogic
* Authentication problem. Ignoring this.
< WWW-Authenticate: Digest realm="public", qop="auth", nonce="
c271c4cc64c2593eccb221ca7d759b45", opaque="6b056756d9b02f88"
< Content-Type: text/html; charset=utf-8
< Content-Length: 209
< Connection: Keep-Alive
< Keep-Alive: timeout=5
<
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>401 Unauthorized</title>
<meta name="robots" content="noindex,nofollow"/>
</head>
<body>
<h1>401 Unauthorized</h1>
</body>
</html>
I have varied the server blacklist.and stepped through with gdb and
observed server_blacklist is getting set properly ... no joy and struggling
to understand.
any ideas ?
thx in advance, Jim Fuller
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-02-05