Daniel Stenberg | 2 Jan 13:27 2005
Picon

Re: Problems with formfind.pl and curl

On Thu, 30 Dec 2004, arturo didonna wrote:

> I am using the 'formfind.pl' program in order to extract the fields to fill 
> for posting data by using curl.

Consider the formfind.pl tool as somewhat unsupported. I don't have enough 
time or energy to maintain it. Of course, someone else _could_ do it but I 
doubt it'll happen.

In general, using LiveHTTPHeaders to figure out what to post is a much smarter 
and faster approach anyway.

--

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html

Patrick Smith | 4 Jan 04:50 2005
Picon

vsnprintf called twice

In 7.12.3, the function Curl_failf in lib/sendf.c can call vsnprintf 
twice in succession on the same variable data, with no reset between the 
calls.

Unfortunately, vsnprintf can leave the variable data in an undefined 
state.  On my machine (Linux running on a PowerMac), this causes a 
segmentation fault in the second call to vsnprintf.  I've only seen this 
happen on things like

	curl -v non-existing-and-weeeeeeirdname

(taken from testcase 20, if I remember correctly).

The attached patch fixes this.
--- lib/sendf.c.orig	2004-12-06 18:04:31.000000000 -0500
+++ lib/sendf.c	2005-01-03 22:04:18.381988638 -0500
 <at>  <at>  -154,15 +154,20  <at>  <at> 
 void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
 {
   va_list ap;
-  va_start(ap, fmt);
   if(data->set.errorbuffer && !data->state.errorbuf) {
+    va_start(ap, fmt);
     vsnprintf(data->set.errorbuffer, CURL_ERROR_SIZE, fmt, ap);
+    va_end(ap);
+
     data->state.errorbuf = TRUE; /* wrote error string */
   }
(Continue reading)

Tom Lee | 4 Jan 07:48 2005
Picon

curl latest version failed with ftp upload


Hello,

I tried latest curl.exe with non-ssl version for uploading files.

the remote ftpd server is ProFTPD 1.2.9 Server (ProFTPD) running on fedora 
core 1.

I run the folllowing command from Windows XP machine:

curl -v -u userame:password -T myfile.exe ftp://remote_IP//tmp

it logs on "remote_IP" and changes the directory successfully,
however it failed wit the following error message in the end:

*   Trying remote_IP... * Connection refused
* couldn't connect to host
* Remembering we are in dir /myfile.exe
* Uploaded unaligned file size (0 out of 2479503 bytes)
* Closing connection #0
curl: (7) couldn't connect to host

I tried to XP ftp.exe, it will work fine for uploading file.  does somebody 
here know
curl.exe failed?

Thanks.

tom

(Continue reading)

Daniel Stenberg | 4 Jan 09:54 2005
Picon

Re: vsnprintf called twice

On Mon, 3 Jan 2005, Patrick Smith wrote:

> In 7.12.3, the function Curl_failf in lib/sendf.c can call vsnprintf twice 
> in succession on the same variable data, with no reset between the calls.

Yes. None of the autobuilds failed on it, so it went unnoticed to release but 
has since been fixed in CVS.

> On my machine (Linux running on a PowerMac), this causes a segmentation 
> fault in the second call to vsnprintf.

You may take this as a hint that we could use such a platform in the autobuild 
tests to prevent future mistakes such as this...

--

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html

Daniel Stenberg | 4 Jan 09:58 2005
Picon

Re: curl latest version failed with ftp upload

On Tue, 4 Jan 2005, Tom Lee wrote:

> I tried latest curl.exe with non-ssl version for uploading files.

Latest being 7.12.3 I presume?

> however it failed wit the following error message in the end:

...

> I tried to XP ftp.exe, it will work fine for uploading file.  does somebody 
> here know curl.exe failed?

First, you should post the full trace output as that would make it easier for 
us to understand what happened.

Then, comparing with the XP ftp is not really useful unless you provide a good 
trace/debug output from that one as well. For example, I believe the vanilla 
windows ftp client defaults to using PORT while curl defaults to PASV, which 
may very well be the difference that made it work.

--

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html

Patrick Smith | 4 Jan 16:22 2005
Picon

Re: vsnprintf called twice

Daniel Stenberg wrote:
> On Mon, 3 Jan 2005, Patrick Smith wrote:
>> In 7.12.3, the function Curl_failf in lib/sendf.c can call vsnprintf 
>> twice in succession on the same variable data, with no reset between 
>> the calls.
> 
> Yes. None of the autobuilds failed on it, so it went unnoticed to 
> release but has since been fixed in CVS.

Oops.  Guess I should have checked CVS before bothering you with another 
report.  Sorry about that.

Tom Lee | 4 Jan 20:12 2005
Picon

Re: curl latest version failed with ftp upload


>From: Daniel Stenberg <daniel-curl <at> haxx.se>
>Reply-To: curl tool talk <curl-users <at> cool.haxx.se>
>To: curl tool talk <curl-users <at> cool.haxx.se>
>Subject: Re: curl latest version failed with ftp upload
>Date: Tue, 4 Jan 2005 09:58:35 +0100 (CET)
>
>On Tue, 4 Jan 2005, Tom Lee wrote:
>
>>I tried latest curl.exe with non-ssl version for uploading files.
>
>Latest being 7.12.3 I presume?

yes, here is the error message:

C:\> curl -v -u username:password -T myfile.exe ftp://IP_ADDRESS//
* About to connect() to IP_ADDRESS port 21
*   Trying IP_ADDRESS... * connected
* Connected to IP_ADDRESS (IP_ADDRESS) port 21
< 220 ProFTPD 1.2.9 Server (ProFTPD) [company.com]
>USER wcheng
< 331 Password required for username.
>PASS password
< 230 User username logged in.
* We have successfully logged in
>PWD
< 257 "/home/username" is current directory.
* Entry path is '/home/username'
>EPSV
< 229 Entering Extended Passive Mode (|||53488|)
(Continue reading)

Daniel Stenberg | 4 Jan 20:32 2005
Picon

Re: curl latest version failed with ftp upload

On Tue, 4 Jan 2005, Tom Lee wrote:

>> EPSV
> < 229 Entering Extended Passive Mode (|||53488|)
> *   Trying IP_ADDRESS... * Connection refused
> * couldn't connect to host

The server opened a new port for curl. curl tries to connect to it, but fails.

Either the server is behind a firewall that doesn't let you in on that port, 
or you are behind a firewall that doesn't let you out on that port (or 
similar).

Reading up on and using the -P option is my advice.

--

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html

Tom Lee | 5 Jan 00:38 2005
Picon

Re: curl latest version failed with ftp upload


>From: Daniel Stenberg <daniel-curl <at> haxx.se>
>Reply-To: curl tool talk <curl-users <at> cool.haxx.se>
>To: curl tool talk <curl-users <at> cool.haxx.se>
>Subject: Re: curl latest version failed with ftp upload
>Date: Tue, 4 Jan 2005 20:32:06 +0100 (CET)
>
>On Tue, 4 Jan 2005, Tom Lee wrote:
>
>>>EPSV
>>< 229 Entering Extended Passive Mode (|||53488|)
>>*   Trying IP_ADDRESS... * Connection refused
>>* couldn't connect to host
>
>The server opened a new port for curl. curl tries to connect to it, but 
>fails.
>
>Either the server is behind a firewall that doesn't let you in on that 
>port, or you are behind a firewall that doesn't let you out on that port 
>(or similar).
>
>Reading up on and using the -P option is my advice.

I think the client (XP machine) might be behind the firewall.

I tried the following command and it only lists the directory in the server 
side, not
doing the upload. Did I miss something?

curl -v -u username:password -P -T myfile.exe ftp://IP_ADDRESS//
(Continue reading)

Tom Lee | 5 Jan 00:43 2005
Picon

Re: curl latest version failed with ftp upload


>From: "Tom Lee" <tom_lee01 <at> hotmail.com>
>Reply-To: curl tool talk <curl-users <at> cool.haxx.se>
>To: curl-users <at> cool.haxx.se
>Subject: Re: curl latest version failed with ftp upload
>Date: Tue, 04 Jan 2005 23:38:12 +0000
>
>
>
>>From: Daniel Stenberg <daniel-curl <at> haxx.se>
>>Reply-To: curl tool talk <curl-users <at> cool.haxx.se>
>>To: curl tool talk <curl-users <at> cool.haxx.se>
>>Subject: Re: curl latest version failed with ftp upload
>>Date: Tue, 4 Jan 2005 20:32:06 +0100 (CET)
>>
>>On Tue, 4 Jan 2005, Tom Lee wrote:
>>
>>>>EPSV
>>>< 229 Entering Extended Passive Mode (|||53488|)
>>>*   Trying IP_ADDRESS... * Connection refused
>>>* couldn't connect to host
>>
>>The server opened a new port for curl. curl tries to connect to it, but 
>>fails.
>>
>>Either the server is behind a firewall that doesn't let you in on that 
>>port, or you are behind a firewall that doesn't let you out on that port 
>>(or similar).
>>
>>Reading up on and using the -P option is my advice.
(Continue reading)


Gmane