Vlad Grachov | 1 Oct 2008 12:25
Picon

Re: [LIBSSH2_ERROR_EAGAIN problem] proposed patch for curl/libssh2 bugfix

I'm sorry for posting the same again to a different list.
I just didn't see your reply to my letter in the library list so I thought you missed it or something.

I changed my patch files a little bit:
1. libssh2.h header contains a new define HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION
2. Added a man page for a new function in libssh2
3. Function is now named libssh2_session_block_directions; constant names are changed a bit as well
4. Inbound and outbound constants are now 0x01 and 0x02 to be used in the binary mask
5. libcurl's ssh.c #ifdefs HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION

It seems in case of multi interface the patch causes a wrong behavior. The wait (select) should be done on a number of sockets in one place.
But my patch calls select inside ssh_statemach_act. I think I may need some help here.
The patch works well for easy interface but will cause lags if used in multi interface.

Best regards. Vlad.

On Mon, Sep 29, 2008 at 8:28 PM, Daniel Stenberg <daniel <at> haxx.se> wrote:
On Mon, 29 Sep 2008, Vlad Grachov wrote:

Thanks! But I do have a few comments on this:

First, please give us at least a week to respond until you resend the same stuff. You can check http://curl.haxx.se/lxr/source/TODO-RELEASE to figure out if your issue is added for pending "action".

Then, you post libcurl stuff to the users list which we generally discourage since you cut out the vast majority of libcurl hackers that hang out on the correct list: curl-library

Thirdly, your patch to libssh2 should be posted to the libssh2 list for consideration for that project. I would also suggest that you add a man page for the new function, to make it easier to the libssh2 crowd to understand the function and how to use it.


The problem is related to libssh2 as well because LIBSSH2_ERROR_EAGAIN return code does not provide any information about the cause of would-block. Regardless of whether recv() or send() returned EAGAIN all the information curl can get from libssh2 is the one and same LIBSSH2_ERROR_EAGAIN error code.

The proposed 2 patches are a patch to libssh2 and a patch to curl. They modify the libraries in a minor way.

Since this libcurl patch makes libcurl depend on this change in libssh2 it would also make sense to do a "best effort" for the cases where the libssh2 is not up-to-date with this. That is, #ifdefed on HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION.

But also, I would rather change the libssh2 function's meaning to instead be "I want you to wait for these actions on the socket before you call the libssh2 function again" since that would then allow libssh2 to actually wait for multiple actions without the API having to be changed again. The function would then return 1 or 2 bits set in a bitmask.

The libcurl part of the patch would then also need to be modified accordingly.


The patched curl no longer waste CPU when the socket would block. Tested under Linux and Windows.

That's indeed very nice to see!

--

 / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Attachment (curl_block_dir.patch): application/octet-stream, 3388 bytes
Attachment (libssh2_block_dir.patch): application/octet-stream, 6398 bytes
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Sajith T S | 1 Oct 2008 17:46
Picon
Gravatar

curl + cyassl?

Apologies if this was answered before: anyone's had success building
curl with cyassl?  Note that I'm not asking about yassl, but the
"plain vanilla" C version of the same library.  I've had some success
with yassl, but it's got a larger footprint.

I can't figure out where to look for libcrypto when cyassl is used.

--

-- 
"the lyf so short, the craft so long to lerne."  
     	         -- Chaucer.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Dan Fandrich | 1 Oct 2008 19:48
Favicon

Re: curl + cyassl?

On Wed, Oct 01, 2008 at 09:16:40PM +0530, Sajith T S wrote:
> Apologies if this was answered before: anyone's had success building
> curl with cyassl?  Note that I'm not asking about yassl, but the
> "plain vanilla" C version of the same library.  I've had some success
> with yassl, but it's got a larger footprint.
> 
> I can't figure out where to look for libcrypto when cyassl is used.

Does cyassl support the OpenSSL compatibility layer?  If not, then it won't
work out of the box since curl supports yassl only in OpenSSL compatibility
mode.  It probably wouldn't be a huge project to support yassl's native API
but nobody has done so yet.

>>> Dan
--

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Daniel Stenberg | 1 Oct 2008 19:51
Picon
Favicon
Gravatar

Re: curl + cyassl?

On Wed, 1 Oct 2008, Sajith T S wrote:

> Apologies if this was answered before: anyone's had success building curl 
> with cyassl?  Note that I'm not asking about yassl, but the "plain vanilla" 
> C version of the same library.  I've had some success with yassl, but it's 
> got a larger footprint.

Let me also point out that while I've succeeded on building curl with yassl 
several times in the past, I've _never_ seen it go through the test suite 
successfully...

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Michael Schreiber | 2 Oct 2008 05:45
Picon

suppress multipart response when retrieving non-overlapping range from file

Hi All,
Is there a method for suppressing the multi-part response when
grabbing a non-overlapping range from a file?

i.e.: When running the following command:
curl -f -s -r "100-200,340-480,500-600" $url -o $OUTDIR/$file.tmp

By default (and according to the man page), I receive multi-part
messages which include a header about the Content-type, the charset
and the Content-range. I really don't need this, and it's a pain when
I'm downloading parts of a binary file, and so I would need to find a
way to strip this out. Any suggestions/recommendations/ways to
suppress the multi-part response? I really only want the merged pieces
of the file, nothing else.

Thanks!
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Dan Fandrich | 2 Oct 2008 08:20
Favicon

Re: suppress multipart response when retrieving non-overlapping range from file

On Wed, Oct 01, 2008 at 11:45:20PM -0400, Michael Schreiber wrote:
> Is there a method for suppressing the multi-part response when
> grabbing a non-overlapping range from a file?

No. It's a mandatory part of HTTP 1.1:

   When an HTTP 206 (Partial Content) response message includes the
   content of multiple ranges (a response to a request for multiple
   non-overlapping ranges), these are transmitted as a multipart
   message-body. The media type for this purpose is called
   "multipart/byteranges".

If you write a program to use libcurl directly, you could send multiple
simultaneous pipelined requests, each requesting a different part of the
file.  The resulting data would be automatically concatenated the way you
want and would be just about as efficient as a single request.  But you
can't do that from the command-line client.

>>> Dan
--

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Sajith T S | 3 Oct 2008 14:12
Picon
Gravatar

Re: curl + cyassl?

Dan Fandrich <dan <at> coneharvesters.com> wrote:

> Does cyassl support the OpenSSL compatibility layer?  If not, then it won't
> work out of the box since curl supports yassl only in OpenSSL compatibility
> mode.  It probably wouldn't be a huge project to support yassl's native API
> but nobody has done so yet.

As far as I can tell (which isn't much anyway...), right now openssl
comaptibility layer isn't quite there.  I'm told that it "should be
close".

https://sourceforge.net/forum/forum.php?thread_id=2307258&forum_id=439590

--

-- 
"the lyf so short, the craft so long to lerne."  
     	         -- Chaucer.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Gallegos, Alfonso | 3 Oct 2008 20:06

(unknown)

When trying to perform an FTPS to a site I get this message.  Can anybody help?

$ curl --ftp-ssl --sslv3 --ftp-pasv --verbose --cert ./publickey.pem --key ./privatekey.pem --user user1:password ftp://website.com

* About to connect() to website.com port 21

*   Trying 216.131.49.30... * connected

* Connected to test-sift.53.com (216.131.49.30) port 21

< server:6021 FTP server (webMethods Integration Server version 6.5) ready.

> AUTH SSL

< 234 AUTH SSL OK.

Enter PEM pass phrase:

* successfully set certificate verify locations:

*   CAfile: /usr/share/ssl/certs/ca-bundle.crt

  CApath: none

* error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag

* Closing connection #0

curl: (35) error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag

Thanks.








Visit us on the Web at: http://www.mesirowfinancial.com


This communication may contain privileged and/or confidential information. It
is intended solely for the use of the addressee. If you are not the intended
recipient, you are strictly prohibited from disclosing, copying, distributing
or using any of this information. If you received this communication in error,
please contact the sender immediately and destroy the material in its entirety,
whether electronic or hard copy. Confidential, proprietary or time-sensitive
communications should not be transmitted via the Internet, as there can be no
assurance of actual or timely delivery, receipt and/or confidentiality. This
is not an offer, or solicitation of any offer to buy or sell any security, investment
or other product.


Please consider the environment before printing this e-mail.


-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Raymond C. Glassford | 4 Oct 2008 16:09
Favicon

Resolving Indirect Download Links

I would like to know if there is a procedure, perl script or otherwise, that 
will resolve indirect download links contained on referer pages, then make 
the resolved links available to curl for downloading, with as little user 
interaction as possible.

As an example, see the links contained on the "Downloads" page at:

http://www.java.com

where I want to download the self-extracting Linux binary, 
named "jre-6u7-linux-i586.bin" using curl, not the Mozilla Firefox download 
manager.

I am running curl 7.15.5 under Mandriva Linux 2007.0.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Daniel Stenberg | 4 Oct 2008 20:07
Picon
Favicon
Gravatar

Re: your mail

On Fri, 3 Oct 2008, Gallegos, Alfonso wrote:

> * error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag

When I google for this error, all I get is lots of references to badly 
configured servers being the reason. Are you sure things are fine in the 
server end?

--

-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html


Gmane