Curl/Curb - Adding an on_debug handler causes an exit code of "1"?

R

Rob Foxworthington

Using the very handy Curb from <http://curb.rubyforge.org/>...

Maybe I'm doing something wrong, but it seems that the mere presence
of an on_debug handler causes the exit code of a script to be "1"
instead of "0".

Unfortunately my C skills are non-existent, so I don't understand
Curb's sources. The best I can do is provide this simple test case in
Ruby:

$ cat exit_code.rb
require "curl"
curl = Curl::Easy.new "http://www.google.com/"
curl.perform

$ ruby exit_code.rb ; echo $?
0

$ cat exit_code_on_debug.rb
require "curl"
curl = Curl::Easy.new "http://www.google.com/"
curl.on_debug { |type, data| true }
curl.perform

$ ruby exit_code_on_debug.rb ; echo $?
1

Using Curb 0.1.4, tried the above on Mac OS X 10.4 (ruby 1.8.6, curl
7.17.0) and CentOS 5 (ruby 1.8.5, curl 7.15.5)... same results.

Any hints, workaround, etc very much appreciated. -- Thanks!

Background: I have some Rake tasks that call code involving Curl/Curb
with an on_debug handler attached (used to capture "Cookie:" headers
added by libcurl's cookie engine). After the Curl/Curb stuff is
called, the exit code is "1" and Rake aborts, preventing follow-up
tasks from running.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top