cURL / Mailing Lists / curl-users / Single Mail

curl-users

proxytunnel no longer working for ftp after c43127414d89ccb9ef6517081f68986d991bcfb3

From: Scott MacFiggen <smacfiggen_at_gmail.com>
Date: Mon, 21 Oct 2013 12:34:15 -0700

I recently upgraded from curl 7.19 to 7.30 and a couple of teams have
reported back to me that this broke a use case, both around doing ftp over
proxyconnect. The result is the transfer just hangs (see output below)

So first question is, can anyone replicate? I only have access to the proxy
servers where I work which are somewhat custom so would be great if anyone
can let me know if this reproduces on a different proxy.

My simple use case is:
curl -v -m 300 -p -x <proxy> ftp://www.kernel.org/pub/linux/kernel/README

Using git bi-sect I tracked this down to the following commit:

commit c43127414d89ccb9ef6517081f68986d991bcfb3
Author: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu Jan 17 12:59:23 2013 +0100

    always-multi: always use non-blocking internals

    Remove internal separated behavior of the easy vs multi intercace.
    curl_easy_perform() is now using the multi interface itself.

    Several minor multi interface quirks and bugs have been fixed in the
    process.

    Much help with debugging this has been provided by: Yang Tse

Here is a verbose output with debug output enabled:
* About to connect() to proxy XXX port 8080 (#0)
* Trying XXX...
* 0x651708 is at send pipe head!
* STATE: CONNECT => WAITCONNECT handle 0x66da38; line 1032 (connection #0)
* Connected to XXX (XXX) port 8080 (#0)
* Establish HTTP proxy tunnel to www.kernel.org:21
> CONNECT www.kernel.org:21 HTTP/1.1
> Host: www.kernel.org:21
> User-Agent: curl/7.28.2-DEV
> Proxy-Connection: Keep-Alive
>
* STATE: WAITCONNECT => WAITPROXYCONNECT handle 0x66da38; line 1142
(connection #0)
* Multi mode finished polling for response from proxy CONNECT
< HTTP/1.1 200 Connection established
< Content-Type: text/plain
< Date: Mon, 21 Oct 2013 18:14:54 GMT
< Connection: keep-alive
< Content-Length: 0
<
* Proxy replied OK to CONNECT request
* STATE: WAITPROXYCONNECT => WAITCONNECT handle 0x66da38; line 1107
(connection #0)
* FTP 0x677008 (line 3246) state change from STOP to WAIT220
* STATE: WAITCONNECT => PROTOCONNECT handle 0x66da38; line 1145 (connection
#0)
< 220 Welcome to kernel.org
> USER anonymous
* FTP 0x677008 (line 845) state change from WAIT220 to USER
< 331 Please specify the password.
> PASS ftp_at_example.com
* FTP 0x677008 (line 2630) state change from USER to PASS
< 230 Login successful.
> PWD
* FTP 0x677008 (line 857) state change from PASS to PWD
< 257 "/"
* Entry path is '/'
* FTP 0x677008 (line 2938) state change from PWD to STOP
* protocol connect phase DONE
* STATE: PROTOCONNECT => DO handle 0x66da38; line 1164 (connection #0)
* DO phase starts
> CWD pub
* FTP 0x677008 (line 942) state change from STOP to CWD
* STATE: DO => DOING handle 0x66da38; line 1223 (connection #0)
< 250 Directory successfully changed.
> CWD linux
< 250 Directory successfully changed.
> CWD kernel
< 250 Directory successfully changed.
> EPSV
* FTP 0x677008 (line 1365) state change from CWD to PASV
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||30420|).
* Trying XXX...
* Connecting to www.kernel.org (XXX) port 8080
* Establish HTTP proxy tunnel to www.kernel.org:30420
* FTP 0x677008 (line 2073) state change from PASV to STOP
* DO phase is complete2
* STATE: DOING => DO_MORE handle 0x66da38; line 1310 (connection #0)

And gdb backtrace shows:
Program received signal SIGINT, Interrupt.
0x0000003a886df218 in poll () from /lib64/libc.so.6
(gdb) where
#0 0x0000003a886df218 in poll () from /lib64/libc.so.6
#1 0x00007ffff7dbb7a8 in Curl_poll (ufds=0x679058, nfds=1,
timeout_ms=1000) at select.c:410
#2 0x00007ffff7db33f7 in curl_multi_wait (multi_handle=0x65b9e8,
extra_fds=0x0, extra_nfds=0, timeout_ms=1000, ret=0x0) at multi.c:885
#3 0x00007ffff7da9ef5 in curl_easy_perform (easy=0x651708) at easy.c:445
#4 0x0000000000410c78 in operate (config=0x7fffffffdf10, argc=8,
argv=0x7fffffffe398) at tool_operate.c:1356
#5 0x000000000040b81c in main (argc=8, argv=0x7fffffffe398) at
tool_main.c:94

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-10-21