curl-library
503 Error
Date: Wed, 8 Aug 2012 11:29:02 +0800 (CST)
Hi all,
I use libcurl to connect ther sever(have HTTPAUTH),then always return error 503. But the VLC player can connect the server ok useing the same network almost at the same time.
I don't know whether it is Libcurl's bug or not,and we use Curl and libcurl 7.17.1, the platform is linux.
My app setup the following options:
curl_easy_setopt(fileData->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); /* can be set to CURL_HTTP_VERSION_1_0 */
curl_easy_setopt(fileData->curl, CURLOPT_URL, file->location);
/* set HTTP Auth , username and password */
#if 1
if(userpwd != NULL)
{
curl_easy_setopt(fileData->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_easy_setopt(fileData->curl, CURLOPT_USERPWD, userpwd); /* set user and password */
}
#endif
curl_easy_setopt(fileData->curl, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(fileData->curl, CURLOPT_FORBID_REUSE, 1);
curl_easy_setopt(fileData->curl, CURLOPT_WRITEDATA, file);
curl_easy_setopt(fileData->curl, CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(fileData->curl, CURLOPT_WRITEHEADER, file);
curl_easy_setopt(fileData->curl, CURLOPT_HEADERFUNCTION, header_callback);
//curl_easy_setopt(fileData->curl, CURLOPT_RESUME_FROM_LARGE, offset);
curl_easy_setopt(fileData->curl, CURLOPT_USERAGENT, "HbbTV1.1.1(;;;;;); CE-HTML; SPARK");
#ifdef PROXY_SETTING
curl_easy_setopt(fileData->curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_easy_setopt(fileData->curl, CURLOPT_PROXY, (char*)"http://164.129.133.10:8080");
curl_easy_setopt(fileData->curl, CURLOPT_PROXYUSERPWD, "username:password");
#endif /* PROXY_SETTING */
#ifdef URL_REDIRECTION
curl_easy_setopt( fileData->curl, CURLOPT_FOLLOWLOCATION, TRUE );
curl_easy_setopt( fileData->curl, CURLOPT_MAXREDIRS, 10 );
#endif /* URL_REDIRECTION */
Below is debug infos:
* About to connect() to iptv.tjurk.com port 5953 (#0)
* Trying 188.165.228.55...
* Connected to iptv.tjurk.com (188.165.228.55) port 5953 (#0)
* Server auth using Basic with user 'spor5'
> GET / HTTP/1.1
Authorization: Basic c3BvcjU6MjIyNA==
User-Agent: HbbTV1.1.1(;;;;;); CE-HTML; SPARK
Host: iptv.tjurk.com:5953
Accept: */*
< HTTP/1.1 503 Service Temporarily Unavailable
< Server: nginx
< Date: Wed, 08 Aug 2012 02:56:53 GMT
< Content-Type: text/html
< Content-Length: 383
383
File Length extracted from Content Length : 383
< Connection: keep-alive
< Keep-Alive: timeout=2
<
* Closing connection #0
How to check out the problem and what can I do? Thank you very much!
----------------------------
Best regards,
LXH
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-08-08