Giter Club home page Giter Club logo

Comments (11)

dbalatero avatar dbalatero commented on September 26, 2024

Ok, I can get the value out of curl/curl.h, and you can write the code to set it? Sound good?

I'll make a branch for it.

from typhoeus.

balexis avatar balexis commented on September 26, 2024

Yea sounds good :)

from typhoeus.

dbalatero avatar dbalatero commented on September 26, 2024

I didn't make a branch. You need to add the following to Typhoeus::Easy::OPTION_VALUES

:CURLOPT_CONNECTTIMEOUT => 78

This was taken, FYI, from curl/curl.h:

/* Time-out connect operations after this amount of seconds, if connects
    are OK within this time, then fine... This only aborts the connect
    phase. [Only works on unix-style/SIGALRM operating systems] */
CINIT(CONNECTTIMEOUT, LONG, 78),

from typhoeus.

dbalatero avatar dbalatero commented on September 26, 2024

Also, please see the comment [Only works on unix-style/SIGALRM operating systems] and address it if you can. Thanks!

from typhoeus.

balexis avatar balexis commented on September 26, 2024

I think I have a first patch that I have tested and works for me available here:
http://gist.github.com/474085
I used the following script to test the new option:
http://gist.github.com/474093

I used the millisecond version of the CONNECTTIMEOUT option, to be consistant with TIMEOUT which is already in millisecond.

I'm sure I missed some details since this is my first ruby patch ever.

As far as the SIGALRM restriction is concerned, its simply the way libcurl triggers any timeout, so it also applies to the TIMEOUT option as well. This signal is conforming to SVr4, POSIX.1-2001 and 4.3BSD, meaning it works on mostly everything except Windows. So this looks like a feature that could be added in libcurl directly, by using timers when running on Windows for example.

from typhoeus.

dbalatero avatar dbalatero commented on September 26, 2024

Verified correctness:

CINIT(CONNECTTIMEOUT_MS, LONG, 156),

from typhoeus.

dbalatero avatar dbalatero commented on September 26, 2024

If you haven't already, you should fork pauldix/typhoeus, create a branch, and push your changes there to review. Using gists for diff is pretty awkward. Let me know when you do that, and send pauldix + dbalatero a pull request?

from typhoeus.

balexis avatar balexis commented on September 26, 2024

Done! And I must say Git makes it pretty easy to do all this, thanks for pointing me in the right direction.

from typhoeus.

balexis avatar balexis commented on September 26, 2024

Hey David,
Do you plan on making a new release soonish with my commit, or should I go and update my server manually?

from typhoeus.

dbalatero avatar dbalatero commented on September 26, 2024

0.1.30 released!

from typhoeus.

dbalatero avatar dbalatero commented on September 26, 2024

Closing.

from typhoeus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.