cURL / Mailing Lists / curl-library / Single Mail

curl-library

[ curl-Bugs-1089455 ] curl_multi_perform doesn't return

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 21 Dec 2004 16:18:47 -0800

Bugs item #1089455, was opened at 2004-12-21 16:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1089455&group_id=976

Category: ftp
Group: hang
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: curl_multi_perform doesn't return

Initial Comment:
Just unsure whether I'm doing something stupid...

I'm using the multi interface to perform a single FTP
download transfer. I deliberately select a bad IP
port, and connect to an invalid server kind. I tested
both 22 (ssh) and 80 (http) with similar results.

At some point, one of the call to curl_multi_perform
simply never returns, and I have to kill it with ^C.
I'd expect the multi interface never to lock.

This is curl 7.12.2 under Linux. Just noticed 7.12.3,
I'll have to try.

Here's test code (diff'ed from multi-app.c)
[jmranger_at_bass examples]$ diff multi-app.c
~/curl-7.12.2/docs/examples/multi-app.c
27,37c27,29
< #define HANDLECOUNT 1 /* Number of simultaneous
transfers */
< #define FTP_HANDLE 0 /* Index for the FTP transfer */
<
<
< CURLMcode print_perform(CURLM *multi_handle, int
*running_handles)
< {
< printf("BEFORE\n");
< CURLMcode res = curl_multi_perform(multi_handle,
running_handles);
< printf("AFTER\n");
< return res;
< }

---
> #define HANDLECOUNT 2   /* Number of simultaneous
transfers */
> #define HTTP_HANDLE 0   /* Index for the HTTP transfer */
> #define FTP_HANDLE 1    /* Index for the FTP transfer */
54a47
>   curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL,
"http://website.com");
56,58c49,50
<   curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL,
"ftp://localhost:22/testfile");
<   curl_easy_setopt(handles[FTP_HANDLE],
CURLOPT_USERPWD, "user:pass");
<   curl_easy_setopt(handles[FTP_HANDLE],
CURLOPT_VERBOSE, 1);
---
>   curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL,
"ftp://ftpsite.com");
>   curl_easy_setopt(handles[FTP_HANDLE],
CURLOPT_UPLOAD, TRUE);
69c61
<         print_perform(multi_handle, &still_running));
---
>         curl_multi_perform(multi_handle,
&still_running));
104c96
<             print_perform(multi_handle, &still_running));
---
>             curl_multi_perform(multi_handle,
&still_running));
118a111,113
>          case HTTP_HANDLE:
>            printf("HTTP transfer completed with
status %d\n", msg->data.result);
>            break;
And here's the output
[jmranger_at_bass examples]$ ./a.out
BEFORE
AFTER
BEFORE
* About to connect() to localhost:22
* Connected to bass.smisrd.com (127.0.0.1) port 22
[jmranger_at_bass examples]$
Please let me know if anything is missing.
Jean-Marc Ranger
jeanmarc.ranger_at_smisrd.com
----------------------------------------------------------------------
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1089455&group_id=976
Received on 2004-12-22