Comments (11)
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.
Yea sounds good :)
from typhoeus.
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.
Also, please see the comment [Only works on unix-style/SIGALRM operating systems]
and address it if you can. Thanks!
from typhoeus.
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.
Verified correctness:
CINIT(CONNECTTIMEOUT_MS, LONG, 156),
from typhoeus.
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.
Done! And I must say Git makes it pretty easy to do all this, thanks for pointing me in the right direction.
from typhoeus.
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.
0.1.30 released!
from typhoeus.
Closing.
from typhoeus.
Related Issues (20)
- How to perform `curl --upload-file` HOT 4
- new release with the timeout changes
- Anyway change the output verbose of libcurl? HOT 1
- feature request: Enhance Request::Stubbable and Request::BlockConnection to partially allow "outside" connections
- Where does defulat `timeout` and `connecttimeout` come from? HOT 1
- Honor Content-Type charset HOT 3
- Empty headers when on_headers callback is called HOT 2
- Sending a header with an empty value
- Is there a way to set forbid_reuse in global config?
- NameError: method `call' not defined in Faraday::Adapter::Typhoeus HOT 3
- Test failures with ethon-0.16.0 HOT 2
- Segmentation fault HOT 2
- Implementing support for delay (retry-after on 429)
- Typehous Faraday Adapter timeouts not working
- tests fail with faraday 2 - faraday-typhoeus should be added as dependency in Gemfile
- No new tags since May 2020 HOT 5
- Could not open library 'libcurl' HOT 1
- How to use flags like OpenSSL::SSL::OP_LEGACY_SERVER_CONNECT? HOT 2
- Memoization does not work as expected HOT 1
- Typhoeus::Response::Informations#return_message test error with curl 8.9.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typhoeus.