Ben Kibbey | 1 Jul 2010 01:08

Re: socket timeouts

On Thu, Jul 01, 2010 at 12:28:02AM +0200, Daniel Stenberg wrote:
> On Wed, 30 Jun 2010, Ben Kibbey wrote:
> 
> >The problem is that the socket is set to non-blocking via
> >curlx_nonblock() so it doesn't seem possible to determine whether
> >the transfer timed out or there was no data available.
> 
> I'm sorry I don't understand what you're trying to accomplish. What
> is the difference between "transfer timed out" and "there was no
> data available" ?

I'm trying to get libcurl to return an error when no data has been
received after some time. Similar I guess to a TCP timeout. My original
post mentioned the SO_RCVTIMEO setsockopt(2) but this cannot work, if I
understand the manual page correctly, because libcurl sets the socket to
non-blocking and the errno would be ambiguous to the non-blocking FD
(EAGAIN).

--

-- 
Ben Kibbey
Jabber: bjk AT thiessen DOT org - (bjk) FreeNode/OFTC
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Paul Romero | 1 Jul 2010 05:24

licurl: SFTP and SSH2

Dear Group:

I  recently downloaded the C version of  libcurl and am a novice.
Is it possible to obtain the SSH2 authentication and encryption
functionality needed by the libcurl version of  SFTP, without
linking to an external SSH2 library ?  If not,  what SSH2
libraries are known to be compact enough to work in am
embedded environment and are compatible with libcurl ?

Best Regards,

Paul R.

--
Paul Romero

RCOM Communications Software

Phone/Fax: (510)339-2628
E-Mail: paulr <at> rcom-software.com

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Xu, Qiang (FXSGSC | 1 Jul 2010 05:55
Favicon

RE: licurl: SFTP and SSH2

> -----Original Message-----
> From: curl-library-bounces <at> cool.haxx.se 
> [mailto:curl-library-bounces <at> cool.haxx.se] On Behalf Of Paul Romero
> Sent: Thursday, July 01, 2010 11:25 AM
> To: curl-library <at> cool.haxx.se
> Subject: licurl: SFTP and SSH2
> 
> Dear Group:
> 
> I  recently downloaded the C version of  libcurl and am a novice.
> Is it possible to obtain the SSH2 authentication and 
> encryption functionality needed by the libcurl version of  
> SFTP, without linking to an external SSH2 library ?  If not,  
> what SSH2 libraries are known to be compact enough to work in 
> am embedded environment and are compatible with libcurl ?

What you need is libssh2: http://www.libssh2.org/. libcurl can call libssh2 to finish SFTP transfer.

Regards,
Xu Qiang
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Donald Boissonneault | 1 Jul 2010 08:26
Picon

OK, I need help

I wrote the following function, however due to slow dns resolving I need
to make it so I can pull like 10 urls at a time or more. Would like to
be able to change that depending on connection speed. Below is the code.
I have been trying to do this with multi-urls for over 3 months. I am
very new to c programming, but am making very good progress. However,
this multi-tasking is really confusing me. How could I turn the below
code into something so it would load the urls IP, HTTP Response code,
URL re-direct address and the html body into a an array. I know the
purpose of programming is to write your own code, but I am totally lost
here. I do not start school till fall and would like to continue working
on my program. If you can help I would be very happy.
 Thank you,
  Don

#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>

using namespace std;

#include "MakeFile.h"

char* memory;
size_t UrlConnectionHtmlBody_size;

static size_t write_data(char *ptr, size_t size, size_t nmemb, void
*stream);

static size_t write_data(char *ptr, size_t size, size_t nmemb, void
*stream)
(Continue reading)

johansen | 1 Jul 2010 18:29
Favicon

Re: Speed performances of curl library

On Tue, Jun 29, 2010 at 11:50:48PM +0200, Daniel Stenberg wrote:
> On Tue, 29 Jun 2010, gonzague.debus <at> centraliens-lille.org wrote:
> 
> >I wrote a script in python (few months ago ) in order to download
> >files from a server, using urllib and urllib2.
> >
> >I re implemented this script in c++ using libcurl, in order to
> >integrate it in a previous c++ project.
> >
> >The downloads rates are much lower with libcurl.
> 
> This is quite the opposite of most other comparisons I've seen in the past.

Indeed.  The OpenSolaris pkg(5) team switched from urllib[2] to pycurl
because the default Python libraries were lacking most recent HTTP
features.  Our project team has been quite pleased with the performance
of curl.

Perhaps you could provide some information about the experiments you
performed, and their results.

-j
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

johansen | 1 Jul 2010 18:35
Favicon

Re: socket timeouts

On Wed, Jun 30, 2010 at 07:08:07PM -0400, Ben Kibbey wrote:
> On Thu, Jul 01, 2010 at 12:28:02AM +0200, Daniel Stenberg wrote:
> > On Wed, 30 Jun 2010, Ben Kibbey wrote:
> > 
> > >The problem is that the socket is set to non-blocking via
> > >curlx_nonblock() so it doesn't seem possible to determine whether
> > >the transfer timed out or there was no data available.
> > 
> > I'm sorry I don't understand what you're trying to accomplish. What
> > is the difference between "transfer timed out" and "there was no
> > data available" ?
> 
> I'm trying to get libcurl to return an error when no data has been
> received after some time. Similar I guess to a TCP timeout. My original
> post mentioned the SO_RCVTIMEO setsockopt(2) but this cannot work, if I
> understand the manual page correctly, because libcurl sets the socket to
> non-blocking and the errno would be ambiguous to the non-blocking FD
> (EAGAIN).

Check these options out.  They do essentially what you're asking for.
In our application, the low-speed limit is set to 1kb.  If the
application doesn't see that much data in 60 seconds, it aborts the
connection.  You can tune this according to your needs, though.

http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTLOWSPEEDLIMIT
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTLOWSPEEDTIME

-j
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
(Continue reading)

johansen | 1 Jul 2010 18:46
Favicon

Re: OK, I need help

On Thu, Jul 01, 2010 at 12:26:04AM -0600, Donald Boissonneault wrote:
> I wrote the following function, however due to slow dns resolving I need
> to make it so I can pull like 10 urls at a time or more. Would like to
> be able to change that depending on connection speed. Below is the code.
> I have been trying to do this with multi-urls for over 3 months. I am
> very new to c programming, but am making very good progress. However,
> this multi-tasking is really confusing me. How could I turn the below
> code into something so it would load the urls IP, HTTP Response code,
> URL re-direct address and the html body into a an array. I know the
> purpose of programming is to write your own code, but I am totally lost
> here. I do not start school till fall and would like to continue working
> on my program. If you can help I would be very happy.
>  Thank you,
>   Don
> 
> 
> 
> #include <curl/curl.h>
> #include <curl/types.h>
> #include <curl/easy.h>
> 
> using namespace std;
> 
> #include "MakeFile.h"
> 
> char* memory;
> size_t UrlConnectionHtmlBody_size;
> 
> static size_t write_data(char *ptr, size_t size, size_t nmemb, void
> *stream);
(Continue reading)

nishit sharma | 1 Jul 2010 18:57
Picon

Invitation to connect on LinkedIn

LinkedIn

I'd like to add you to my professional network on LinkedIn.

- nishit

nishit sharma
software engineer at samsung
Noida Area, India

Confirm that you know nishit

© 2010, LinkedIn Corporation

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Adam Kellas | 1 Jul 2010 19:55
Picon

Re: OK, I need help

On 7/1/2010 2:26 AM, Donald Boissonneault wrote:
> #include "MakeFile.h"

And please don't name a source file "MakeFile*" - you're just begging 
for confusion with actual Makefiles.

AK

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Volkan Unsal | 1 Jul 2010 20:10
Picon
Gravatar

Cannot install libcurl bindings gem (curb) on Windows

I need some help debugging libcurl issues, and I don’t know where to go. The problem is I cannot install the libcurl Ruby bindings on Windows, and keep getting this error

C:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.7.1/ext/curb_postfield.c:76: undefined reference to ‘imp_curl_formadd’

This is one of the many errors about not being able to find references to imp_curl_something. Can anyone help?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Gmane