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

Discussion in 'Ruby' started by Rob Foxworthington, Oct 18, 2007.

  1. 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.
    Rob Foxworthington, Oct 18, 2007
    #1
    1. Advertising

  2. Re: Curl/Curb - Adding an on_debug handler causes an exit code of"1"?

    Follow-up: Upgrading to Ruby 1.8.6p110 seems to fix the problem.
    Rob Foxworthington, Nov 11, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FuZHk=?=

    Code to Exit Web App and Exit Internet Explorer

    =?Utf-8?B?U2FuZHk=?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    7,874
    =?Utf-8?B?U2FuZHk=?=
    Aug 5, 2005
  2. Joe Smith
    Replies:
    4
    Views:
    65,788
    sandeep1976
    Nov 8, 2006
  3. James Leddy

    Code causes segfault on exit

    James Leddy, Oct 15, 2003, in forum: C Programming
    Replies:
    7
    Views:
    397
    Irrwahn Grausewitz
    Oct 16, 2003
  4. Yujo
    Replies:
    2
    Views:
    394
    Gabriel Genellina
    Apr 10, 2007
  5. Ross Bamford

    [ANN] Curb 0.0.2 released

    Ross Bamford, Nov 24, 2006, in forum: Ruby
    Replies:
    0
    Views:
    77
    Ross Bamford
    Nov 24, 2006
Loading...

Share This Page