curl-library
Re: Upload file over proxy with mandatory delay after send headers
Date: Fri, 29 Dec 2006 13:39:07 +0300
Клюквин Андрей пишет:
> Hello.
> I'm using libcurl in my project.
> I need to upload file over proxy with NTLM auth.
> The option for proxy auth is 'ANY':
>
> curl_easy_setopt(curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
>
> This is the trace from CURLOPT_DEBUGFUNCTION
>
> About to connect() to proxy moon port 3128 (#0)
> Trying 192.168.100.231...
> connected
> Connected to moon (192.168.100.231) port 3128 (#0)
> POST http://klukvin:8889/files/main.jsp HTTP/1.1
> User-Agent: HTTPPost/2.0 (Windows NT 5.1)
> Host: klukvin:8889
> Pragma: no-cache
> Accept: */*
> Proxy-Connection: Keep-Alive
> Content-operation: 0
> Content-Length: 327428
> Content-Type: multipart/form-data;
> boundary=----------------------------352292fc995c
>
> ------------------------------352292fc995c
> Content-Disposition: form-data; name="File0"; filename="mov00004.3gp"
> Content-Type: application/octet-stream
>
>
> Send failure: Connection was aborted
> failed sending data to the peer
> Closing connection #0
>
> I.e. I've got error 55.
> You can see body (from line ------------------------------352292fc995c) but
> there is no response from server.
>
> But if I use Sleep(...) function after send headers like this:
>
> int CPBUpload::TraceFunction(CURL *handle, curl_infotype type, unsigned char
> *data, size_t size, void *lpParameter)
> {
> int i = 0;
> CLogger::Log((LPCTSTR)data);
> switch (type) {
> case CURLINFO_HEADER_OUT:
> Sleep(1);
> break;
> ...
>
> the file uploaded successfully:
>
> About to connect() to proxy moon port 3128 (#0)
> Trying 192.168.100.231...
> connected
> Connected to moon (192.168.100.231) port 3128 (#0)
> POST http://klukvin:8889/files/main.jsp HTTP/1.1
> User-Agent: HTTPPost/2.0 (Windows NT 5.1)
> Host: klukvin:8889
> Pragma: no-cache
> Accept: */*
> Proxy-Connection: Keep-Alive
> Content-operation: 0
> Content-Length: 327428
> Content-Type: multipart/form-data;
> boundary=----------------------------cce05b983f90
>
>
> HTTP/1.1 407 Access Denied
> Server: WinGate 6.0.4 (Build 1025)
> ...
>
>
> I have success upload also if I'am set proxy auth as 'NTLM' initially.
>
> May be THIS proxy-server need delay (Wingate 6)?
> Thank you.
>
> P.S. Sorry for my english
>
I've set CURLOPT_TCP_NODELAY to TRUE. This is solve problem but I don't
understand what does it mean on the whole
Received on 2006-12-29