cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl-users Digest, Vol 18, Issue 19

From: Guirong Wang <guirong2004_at_yahoo.com>
Date: Tue, 20 Feb 2007 12:56:08 -0800 (PST)

Thank you Doug and Daniel. There are some hidden fields in the form. Now it works.
   
  Thanks again.
  Karen

curl-users-request_at_cool.haxx.se wrote:
  Send curl-users mailing list submissions to
curl-users_at_cool.haxx.se

To subscribe or unsubscribe via the World Wide Web, visit
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
or, via email, send a message with subject or body 'help' to
curl-users-request_at_cool.haxx.se

You can reach the person managing the list at
curl-users-owner_at_cool.haxx.se

When replying, please edit your Subject line so it is more specific
than "Re: Contents of curl-users digest..."

Today's Topics:

1. CURLOPT_RANGE reset for ftp broken in new curl ?
(Duncan Mac-Vicar Prett)
2. Re: CURLOPT_RANGE reset for ftp broken in new curl ?
(Daniel Stenberg)
3. Re: CURLOPT_RANGE reset for ftp broken in new curl ?
(Daniel Stenberg)
4. Re: CURLOPT_RANGE reset for ftp broken in new curl ?
(Duncan Mac-Vicar Prett)
5. fill out a post form with cURL (Guirong Wang)
6. Re: fill out a post form with cURL (Doug McNutt)
7. Re: fill out a post form with cURL (Daniel Stenberg)
8. specify range with http PUT (John Meissen)
9. SSL Context not cleaned up in multi handle (Lau, Hang Kin)

----------------------------------------------------------------------

Message: 1
Date: Fri, 16 Feb 2007 12:35:32 +0100
From: Duncan Mac-Vicar Prett
Subject: CURLOPT_RANGE reset for ftp broken in new curl ?
To: curl-users_at_cool.haxx.se
Message-ID: <200702161235.32556.dmacvicar_at_suse.de>
Content-Type: text/plain; charset="iso-8859-1"

Hi guys!

Our media library broke with a curl upgrade. We use CURLOPT_RANGE to see if a
file exists for protocols not supporting globbing. After setting the range we
set it back to null.

After the upgrade, the reset doesn't seem to work anymore for ftp.

Test program attached.

What it does, it downloads content file 3 times via ftp, for the number2 it
sets the range to 2 bytes but it resets it before getting number 3.

content number 3 is 2 bytes so the reset is not working.
curl_easy_setopt( curl, CURLOPT_RANGE, NULL );

If you change the URL to http, the behavour is correct again.

Is this a known bug?

Regards
Duncan

--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N?rnberg)
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftpget.c
Type: text/x-csrc
Size: 2954 bytes
Desc: not available
Url : http://cool.haxx.se/pipermail/curl-users/attachments/20070216/7f291352/attachment-0001.c 
------------------------------
Message: 2
Date: Fri, 16 Feb 2007 14:57:26 +0100 (CET)
From: Daniel Stenberg 
Subject: Re: CURLOPT_RANGE reset for ftp broken in new curl ?
To: the curl tool 
Message-ID: 
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Fri, 16 Feb 2007, Duncan Mac-Vicar Prett wrote:
(the curl-library mailing list is better suited for libcurl issues...)
> Our media library broke with a curl upgrade.
Upgrading from what version to what version?
> Test program attached.
Great. I'll have a look.
> Is this a known bug?
No, this is news to me at least.
-- 
Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
------------------------------
Message: 3
Date: Fri, 16 Feb 2007 15:24:19 +0100 (CET)
From: Daniel Stenberg 
Subject: Re: CURLOPT_RANGE reset for ftp broken in new curl ?
To: the curl tool 
Message-ID: 
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Fri, 16 Feb 2007, Duncan Mac-Vicar Prett wrote:
> Test program attached.
Test fix:
diff -u -r1.395 ftp.c
--- lib/ftp.c 6 Feb 2007 18:06:37 -0000 1.395
+++ lib/ftp.c 16 Feb 2007 14:29:09 -0000
@@ -3285,6 +3285,8 @@
from, to, data->reqdata.maxdownload));
ftpc->dont_check = TRUE; /* dont check for successful transfer */
}
+ else
+ data->reqdata.maxdownload = -1;
return CURLE_OK;
}
-- 
Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
------------------------------
Message: 4
Date: Fri, 16 Feb 2007 17:08:45 +0100
From: Duncan Mac-Vicar Prett 
Subject: Re: CURLOPT_RANGE reset for ftp broken in new curl ?
To: curl-users_at_cool.haxx.se
Message-ID: <200702161708.46467.dmacvicar_at_suse.de>
Content-Type: text/plain; charset="iso-8859-1"
Thanks, our culr maintainer (mmarek) proposed a similar patch, and sent it 
upstream.
Regards!
Duncan
------------------------------
Message: 5
Date: Fri, 16 Feb 2007 11:59:06 -0800 (PST)
From: Guirong Wang 
Subject: fill out a post form with cURL
To: curl-users_at_cool.haxx.se
Message-ID: <949937.61287.qm_at_web50203.mail.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi, all
I am new to cURL. I started to learn curl yesterday. I am trying to fill out a form with cURL. The method used by the form is "POST". I used the following cURL command:
curl -d "user=username&pass=password&submit=submit" https://testsite.com/dir/logproc.asp
and I got the following message:
  Object MovedThis object may be found here.
Can anybody help me out? Any suggestion is highly appreciated.
Regards.
Karen
---------------------------------
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cool.haxx.se/pipermail/curl-users/attachments/20070216/249c416a/attachment-0001.htm 
------------------------------
Message: 6
Date: Fri, 16 Feb 2007 14:39:10 -0700
From: Doug McNutt 
Subject: Re: fill out a post form with cURL
To: curl-users_at_cool.haxx.se
Message-ID: 
Content-Type: text/plain; charset="us-ascii"
At 11:59 -0800 2/16/07, Guirong Wang wrote:
>Hi, all
>I am new to cURL. I started to learn curl yesterday. I am trying to fill out a form with cURL. The method used by the form is "POST". I used the following cURL command:
>curl -d "user=username&pass=password&submit=submit" https://testsite.com/dir/logproc.asp
>and I got the following message:
>
>  Object MovedThis object may be found here.
> 
>Can anybody help me out? Any suggestion is highly appreciated.
Almost surely you're dealing with security issues that are handled quite differently from site to site depending on which side of bed the programmer got up on.
Get the LiveHTTPheaders plug in for the FireFox browser and see what is actually transmitted as the POST from the first page with username and password is sent back. It almost surely has hidden fields that are needed and they may be created with JavaScript or something worse.
At a minimum there will be a cookie used for identification as you make repeated contacts. You'll have to return that too.
If you're on a Macintosh the log file produced by the iCab browser might be more useful than LiveHTTPheaders.
-- 
--> Love your country. But don't trust its government. <--
------------------------------
Message: 7
Date: Fri, 16 Feb 2007 22:41:14 +0100 (CET)
From: Daniel Stenberg 
Subject: Re: fill out a post form with cURL
To: the curl tool 
Message-ID: 
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Fri, 16 Feb 2007, Guirong Wang wrote:
>   Object MovedThis 
> object may be found here.
>
> Can anybody help me out? Any suggestion is highly appreciated.
Check the response headers. I'm quite sure they contain a 30X response code 
and a Location: header...
-- 
Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
------------------------------
Message: 8
Date: Fri, 16 Feb 2007 14:39:33 -0800
From: "John Meissen" 
Subject: specify range with http PUT
To: curl-users_at_cool.haxx.se
Message-ID: <20070216223933.581DAB3E5A_at_john.meissen.org>
Content-Type: text/plain; charset=us-ascii
I'd like to use curl to update small portions of large files on a web sever, 
but it doesn't look like I can make it work.
Specifying the -r/--range option sounds like the logical approach, and it
creates the correct header. But it then starts at the beginning and attempts
to transfer the entire file.
I can use the -C/--continue-at option to specify the correct offset to
start uploading. But there's no way to specify an offset to stop at.
I tried --max-filesize, but that didn't do anything.
It seems to me that -r should be sufficient. Am I not seeing something?
john-
------------------------------
Message: 9
Date: Fri, 16 Feb 2007 17:27:56 -0800
From: "Lau, Hang Kin" 
Subject: SSL Context not cleaned up in multi handle
To: 
Message-ID:
<562C2DF7BE8F8740B2967E8A785B4659728F6D_at_rsmail01.avistar.com>
Content-Type: text/plain; charset="us-ascii"
The flow of my program is similar to this:
curl* pEasyHandle = curl_easy_init();
curl* pMultiHandle = curl_multi_init();
curl_easy_setopt(pEasyHandle, CURLOPT_CAINFO, "cacert.pem");
curl_easy_setopt(pEasyHandle, CURLOPT_SSL_VERIFYPEER, 1);
curl_easy_setopt(pEasyHandle, CURLOPT_SSL_VERIFYHOST, 2);
curl_multi_add_handle(pMultiHandle, pEasyHandle);
while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(pMultiHandle,
&integer);
curl_multi_remove_handle(pMultiHandle, pEasyHandle);
curl_easy_cleanup(pEasyHandle);
curl_multi_cleanup(pMultiHandle);
I am using MSVC .net and I found that when the process terminates, a
large amount of memory blocks were detecting as "memory leaks". I also
found that the content of "cacert.pem" were in those memory blocks.
Those may not be actual memory leaks but the large amount of blocks
detected by MSVC is disturbing as when the process ends, it takes MSVC a
while to display all the blocks.
It seems curl_multi_cleanup() didn't release the SSL ctx in it's
connection cache as curl_easy_cleanup() does.
By making the following changes, it seems to work and cleanup the SSL
ctx correctly but I am not sure if it could break something else?
Index: curl/lib/multi.c
===================================================================
--- curl/lib/multi.c (curl 7.16.0)
+++ curl/lib/multi.c (working copy)
@@ -591,7 +591,10 @@
/* and modify the connectindex since this handle can't point to
the
connection cache anymore */
if(easy->easy_conn)
+ {
+ easy->easy_conn->data = NULL;
easy->easy_conn->connectindex = -1;
+ }
}
/* change state without using multistate(), only to make
singlesocket() do
Index: curl/lib/url.c
===================================================================
--- curl/lib/url.c (curl 7.16.0)
+++ curl/lib/url.c (working copy)
@@ -1687,6 +1687,8 @@
if (!conn)
return;
+ Curl_ssl_close(conn);
+
/* close possibly still open sockets */
if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET])
sclose(conn->sock[SECONDARYSOCKET]);
@@ -1796,8 +1798,6 @@
allocated by libidn */
#endif
- Curl_ssl_close(conn);
-
/* Indicate to all handles on the pipe that we're dead */
if (IsPipeliningEnabled(data)) {
signalPipeClose(conn->send_pipe);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cool.haxx.se/pipermail/curl-users/attachments/20070216/baf34536/attachment.htm 
------------------------------
_______________________________________________
curl-users mailing list
curl-users_at_cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
End of curl-users Digest, Vol 18, Issue 19
******************************************
 
---------------------------------
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
Received on 2007-02-20