cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl-library Digest, Vol 65, Issue 55

From: <romeo.petruca_at_perosoft.org>
Date: Tue, 25 Jan 2011 02:37:25 -0600

Quoting curl-library-request_at_cool.haxx.se:

> Send curl-library mailing list submissions to
> curl-library_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
> or, via email, send a message with subject or body 'help' to
> curl-library-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-library-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-library digest..."
>
>
> Today's Topics:
>
> 1. Re: Is curl_easy_reset broken? (Daniel Stenberg)
> 2. RE: can't figure out why CWD is failing (Daniel Stenberg)
> 3. Re: EPSV vs PASV (Leo)
> 4. breaking a curl_easy_perform (Romeo Petruca)
> 5. Re: breaking a curl_easy_perform (Daniel Stenberg)
> 6. Re: Porting CURL to the AirplaySDK environment (Vsevolod Novikov)
> 7. Re: Base64 encode and decode (amit paliwal)
> 8. Re: Base64 encode and decode (Dan Fandrich)
> 9. MSVC build speed-up patch using "Batch-Mode" (vmpdemo)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 24 Jan 2011 13:16:11 +0100 (CET)
> From: Daniel Stenberg <daniel_at_haxx.se>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Is curl_easy_reset broken?
> Message-ID: <alpine.DEB.2.00.1101241311410.14417_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Mon, 24 Jan 2011, darshan.mody_at_wipro.com wrote:
>
>> I used to reset the curl handle using curl_easy_reset if the handle existed
>> and this worked for me previously. While merging with the latest version my
>> application code was not working as it was intended. The library failed to
>> embedd(XML data) the data that I passed for the second time. So the first
>> request was always sucess and the subsequent requests were failures. Some
>> one did suggested not to use curl_easy_reset. I tried it and it seems to
>> work with the latest LIBCURL version available
>>
>> My query is that should not the curl_easy_reset work as it was working in
>> the previous releases?
>
> Yes it should, except for bugs we fixed of course. It'd be great if
> you could
> provide us with a small recipe showing how repeat this problem. Then we could
> turn that into a test case and make sure it'll remain working even in the
> future...
>
>> From the code from the curl_easy_reset it seems to me that it resets the
>> timer and other data.
>
> curl_easy_reset() should put the handle back in the same state as it was just
> after curl_easy_init() was called. That would imply clearing timers and data,
> wouldn't it?
>
> What exact funtionality did you depend on that is no longer there?
> Perhaps you
> inadvertantly depended on a bug?
>
> --
>
> / daniel.haxx.se
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 24 Jan 2011 13:20:30 +0100 (CET)
> From: Daniel Stenberg <daniel_at_haxx.se>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: RE: can't figure out why CWD is failing
> Message-ID: <alpine.DEB.2.00.1101241317130.14417_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
>
> On Mon, 24 Jan 2011, Vishakha Vaidya wrote:
>
>>> CURLOPT_VERBOSE is always a good string place.
>
>> It says RETR fails. Couldn't retrieve the file. I tried with
>> CURLOPT_CUSTOMREQUEST "cwd \/abc" but result is the same.
>
> I think I'm not understanding this. If you're not allowed to cwd to
> /abc, then
> what is libcurl supposed to do?
>
> The "common" problem with changing directories over FTP is when the client
> isn't allowed to cwd to /abc but the server thinks it is ok to cwd
> to /abc/def
> directly and that's one reason why the CURLOPT_FTP_FILEMETHOD option exists.
>
> If you have a client that manages to do the operation you want, then figure
> out what it does and then look into how to make libcurl do it like that.
>
> --
>
> / daniel.haxx.se
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 24 Jan 2011 14:58:48 -0500
> From: Leo <leo.r_at_rogers.com>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: EPSV vs PASV
> Message-ID: <4D3DD9F8.80600_at_rogers.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 1/20/11 8:58:48 AM, Daniel Stenberg wrote:
>> On Thu, 20 Jan 2011, Michael Wood wrote:
>>
>>>> < 425 Data connection already open.
>>>
>>> OK, so the server thinks there's nothing wrong with EPSV, but libcurl
>>> couldn't connect, so when libcurl retried with PASV, the server says
>>> "Hey! What are you doing? You already asked me to open a port for
>>> EPSV and now you want me to open another one for PASV???"
>>>
>>> I think the only way libcurl can deal with this is to close the
>>> control channel after the EPSV failed and then open a new one when
>>> trying the PASV. Unless maybe an ABOR command would work. But, first
>>> try the latest version of libcurl, because it might already do
>>> something like this. I have not checked.
>>
>> You're right, after the failed connect I suppose libcurl needs to do
>> either an ABOR or a complete close, and it doesn't do any of that now
>> even in the current version.
>>
>> However, judging from that output, it wouldn't completely solve this
>> issue as it takes 75 seconds to fail anyway. That failure seems to be
>> network-related (like a firewall) and just about the only way to avoid
>> that problem is to not even try EPSV...
>>
> Daniel and Michael:
>
> Thanks a lot for getting to the bottom of it! I'll get back to this
> topic soon when a few crazy days are over. :)
>
> Leo
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 24 Jan 2011 23:14:41 +0200
> From: Romeo Petruca <romeo.petruca_at_perosoft.org>
> To: curl-library_at_cool.haxx.se
> Subject: breaking a curl_easy_perform
> Message-ID: <4D3DEBC1.2090906_at_perosoft.org>
> Content-Type: text/plain; charset=ISO-8859-2; format=flowed
>
> Hi,
>
> how can i abort a curl_easy_perform( curl ) activity.
> i have tested this:
>
> curl_global_init( CURL_GLOBAL_WIN32 );
> ........
> curl = curl_easy_init();
> ........
> curl_easy_perform( curl )
> ..........
> curl_easy_cleanup( curl );
> curl_global_cleanup();
>
> but sometime i get error "program has encountered a serious problem
> and needs to close"
>
   SOLVED

   int Abort = 0;

   and in function
   static size_t my_fwrite( void *buffer,
                            size_t size,
                            size_t nmemb,
                            void *stream ) {
      pcmyFTP pcFtp = ( pcmyFTP )stream;

      if ( !Abort )
         return fwrite( buffer, size, nmemb, pcFtp->pFile() );
      return( -1 );
   }
   somewhere in program:
   Abort = 1;
   and that will cause to stop "curl_easy_perform( curl )"
} // ***** Function my_fwrite ***** //

> --
> Romeo Petruca
> Str. Munteniei 2A/48, Romania
> Mobil: +40720301842
> Fix: +40354401534
> e-mail: romeo.petruca_at_perosoft, romeo.petruca_at_yahoo.com
> web: www.perosoft.org
>
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 24 Jan 2011 22:20:35 +0100 (CET)
> From: Daniel Stenberg <daniel_at_haxx.se>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: breaking a curl_easy_perform
> Message-ID: <alpine.DEB.2.00.1101242219290.16709_at_tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Mon, 24 Jan 2011, Romeo Petruca wrote:
>
>> how can i abort a curl_easy_perform( curl ) activity.
>
> http://curl.haxx.se/docs/faq.html#How_do_I_stop_an_ongoing_transfe
>
>> but sometime i get error "program has encountered a serious problem and
>> needs to close"
>
> I'm sorry what does that mean? Isn't that some kind of "illegal" operation
> that is similar to a *nix segfault? If so, can you repeat that with a small
> example using the latest libcurl so that we can test it?
>
> --
>
> / daniel.haxx.se
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 25 Jan 2011 00:30:59 +0300
> From: Vsevolod Novikov <novikov_at_doroga.tv>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Porting CURL to the AirplaySDK environment
> Message-ID: <4D3DEF93.9010900_at_doroga.tv>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Daniel,
>
>>> Not just replace, but be able to add a new one
>>
>> Right, that's what I meant: a new added one replaces c-ares as the one
>> in use during requests as there's only ever one active at a time.
>>
>>> patching only those files which should be. Ideal solution is to make
>>> it possible using configure script (or even runtime option) only, and
>>> proposed patch makes such solution more available.
>>
>> I think selecting resolver backend with configure is good enough. It's
>> already there and working
>
> Not there unfortunately. I meant something like
> ./configure ... --with-custom-resolver=~/myperfectresolver/blablabla.c
>
>> Right, but you've also sacrifised performance and the existing way of
>> operating, so I wanted to know your reasoning for this. Your response
>> here seems to imply that you had no reasoning at all.
> The reason is complexity. I understand that the way which was introduced
> by patch is a bit less optimal than present. The question is - what is a
> size of this "bit"? On the other hand, presence of two data structures
> with different life time, used in the same piece of code, introduces
> additional complexity, and as such, requires much more tests to check,
> whether the code works correctly in different circumstances.
>> There is very limited name resolve testing primarily because it isn't
>> that easy to do in a controlled manner (and we have no DNS test
>> server), and secondary simply because we haven't had anyone work on
>> that...
> This is an additional reason to avoid complexity, discussed above. A you
> sure that the existing resolver code of the curl is bug-free? Less state
> volume, less time to live - less tests to check that all works fine.
>> I think we should allow the resolver backend to have a pointer/handle
>> in the SessionHandle struct for stuff that can be kept around between
>> requests - as the c-ares code works today. And when that is used, the
>> resolver backend also needs to be told when the dup_handle() function
>> is called so that the resolver handle can be duped.
> It was much more useful to have some number of behavioral and data hooks
> which could be used to control custom intermediate filters on a way from
> the URL requesting to data delivering. One of applications for such
> hypotetic filters is - optimizing c-ares resolver storing opened ares
> handler somewhere.
>
> I will try to finalize a work on custom resolver in the developer branch
> of curl.
>
> Regards,
> Vsevolod
>
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 24 Jan 2011 18:49:30 -0500
> From: amit paliwal <amit.ambitions_at_gmail.com>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Base64 encode and decode
> Message-ID:
> <AANLkTind7OzqXruNeK+YQ0h1gn81qv_fu_4xEnXDidWU_at_mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Fri, Jan 21, 2011 at 2:16 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
>> On Fri, 21 Jan 2011, amit paliwal wrote:
>>
>> libcurl base64-encodes control data in a few places automatically when
>>>> required (e.g. for Basic authentication), but it won't encode
>>>> data. If your
>>>> application requires base64-encoded data, it will need to be so encoded in
>>>> the app. And those two functions are not actually part of the
>>>> libcurl API,
>>>> so they aren't even available for use in apps, anyway.
>>>>
>>>
>> So does it mean that if I use TLS and HTTPS I need not to apply it
>>> separately and it will be done automatically??????
>>>
>>
>> It means that libcurl provides an API to do data transfers. You can use
>> that API as documented. libcurl offers transfers using a larger amount of
>> different protocols, and some of those protocols do sometimes require that
>> data is sent base64-encoded and then libcurl will do so.
>>
>> I tried using curl_base64.h, but when i installed the curl package, i did
> not found this .h file in my /usr/local/include/curl directory where other
> .h files like curl.h are present. Do i need to enable it with some
> particular option.
>
>> --
>>
>> / daniel.haxx.se
>>
>> -------------------------------------------------------------------
>> List admin: http://cool.haxx.se/list/listinfo/curl-library
>> Etiquette: http://curl.haxx.se/mail/etiquette.html
>>
>
>
>
> --
> Regards,
> Amit
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://cool.haxx.se/pipermail/curl-library/attachments/20110124/2d22b531/attachment-0001.htm>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 24 Jan 2011 16:25:25 -0800
> From: Dan Fandrich <dan_at_coneharvesters.com>
> To: curl-library_at_cool.haxx.se
> Subject: Re: Base64 encode and decode
> Message-ID: <20110125002524.GA13593_at_coneharvesters.com>
> Content-Type: text/plain; charset=iso-8859-1
>
> On Mon, Jan 24, 2011 at 06:49:30PM -0500, amit paliwal wrote:
>> On Fri, Jan 21, 2011 at 2:16 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>> On Fri, 21 Jan 2011, amit paliwal wrote:
>> On some earlier date, Dan Fandrich wrote this unattributed
>> paragraph:
>> libcurl base64-encodes control data in a few places
>> automatically
>> when required (e.g. for Basic authentication), but it
>> won't encode
>> data. If your application requires base64-encoded data, it will
>> need to be so encoded in the app. ?And those two
>> functions are not
>> actually part of the libcurl API, so they aren't even
>> available for
>> use in apps, anyway.
>>
>> So does it mean that if I use TLS and HTTPS I need not to apply it
>> separately and it will be done automatically??????
>>
>> It means that libcurl provides an API to do data transfers. You can use
>> that API as documented. libcurl offers transfers using a larger
>> amount of
>> different protocols, and some of those protocols do sometimes
>> require that
>> data is sent base64-encoded and then libcurl will do so.
>>
>> I tried using curl_base64.h, but when i installed the curl package,
>> i did not
>> found this .h file in my /usr/local/include/curl? directory where other .h
>> files like curl.h are present. Do i need to enable it with some particular
>> option.
>
> I'm quoting the whole message, because the answer is contained in your own
> e-mail, namely:
>
> And those two functions are not actually part of the libcurl API, so
> they aren't even available for use in apps, anyway.
>
> That means you'll have to reimplement them yourself, or copy the
> source out of
> libcurl. libcurl has a family of curlx_* functions that fall into this sort
> of category of useful, but not really appropriate to have in the libcurl API,
> but the base64 functions aren't included in these.
>
>>>> Dan
>
>
> ------------------------------
>
> Message: 9
> Date: Mon, 24 Jan 2011 17:56:54 -0600
> From: vmpdemo <vmpdemo_at_gmail.com>
> To: curl-library_at_cool.haxx.se
> Subject: MSVC build speed-up patch using "Batch-Mode"
> Message-ID:
> <AANLkTi=HHHuDAtV+aFhMHrvhtM++kkX-RUj03QkkbCCu_at_mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> This thread is created per bagder directive, to track a true resolution for:
>
> https://sourceforge.net/tracker/index.php?func=detail&aid=3112924&group_id=976&atid=100976
>
>
> ------------------------------
>
> _______________________________________________
> curl-library mailing list
> curl-library_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
>
>
> End of curl-library Digest, Vol 65, Issue 55
> ********************************************
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-25