SIGINT and curb

17 views
Skip to first unread message

manu

unread,
Jul 20, 2009, 4:11:53 PM7/20/09
to Curb - Ruby libcurl Bindings
In recent version of CURB , CTRL + C or SIGINT are being ignored. I
tried the following script and still being ignored..
What changed as it used to work before? is there a workaround or a new
way to do that with curb?

require 'rubygems'
require 'curb'

trap('SIGINT'){exit}
url = "http://google.com"
postdatas = []
postdatas << "q=word"
c = Curl::Easy.new(url)
c.http_post( url, postdatas.join("&"))

p c.body_str

thanks

manu

unread,
Jul 20, 2009, 4:28:14 PM7/20/09
to Curb - Ruby libcurl Bindings
Forgot to mention that 0.3.7 is the last version where it behaves
correctly. 0.4.2 and 0.4.4 are both not processing the SIGINT or
disabling/ignoring it

Todd Fisher

unread,
Jul 20, 2009, 4:35:17 PM7/20/09
to curb---ruby-li...@googlegroups.com
Ah, I believe the issue in this case is I switched to using curl_easy_perform when the script is running only one ruby thread....  I'll see if there is a solution that allows it to be interrupted by ruby...  Otherwise will continue to run the request through the multi handle in all cases...

manu

unread,
Jul 20, 2009, 4:50:23 PM7/20/09
to Curb - Ruby libcurl Bindings
Ok. Sounds good. I will wait for a new gem then. I can use the older
version for now

Thanks for your prompt response! you may want to advertise that group
on rubyforge because I was struggling to figure out where to post my
question until I came through that group on google :)

Todd Fisher

unread,
Jul 20, 2009, 4:57:11 PM7/20/09
to curb---ruby-li...@googlegroups.com
Yeah, I actually created this group before I had access to update the rubyforge account, I still only have access to release new gems and can't update the project pages...  I've commited the changes into my fork on github will be updating the rubyforge release soon.
Reply all
Reply to author
Forward
0 new messages