cURL / Mailing Lists / curl-library / Single Mail


Can someone explain why curl_easy_reset is not working?

From: Jonathan C. <>
Date: Sat, 24 May 2014 05:58:50 +0000

This is the code:

It's a binding for Node.js.

I cannot put the whole code here in context. But the binding for the reset method is basically just:

    curl_easy_reset( obj->curl );

Where obj->curl is a pointer to the curl handler in question.

However, looks like it's not resetting the handler, I tested it doing a request, resetting it, and calling perform immediately after (the perform method adds the handler to the internal multi curl instance).

Expected result: An error is thrown, because there is no url set for given handler.
Current result: It does another request to the url set previously.

Code to test if anyone is willing to do so (need to have node.js installed, and node-libcurl, npm install node-libcurl):

var Curl = require( 'node-libcurl' ).Curl;

var curl = new Curl(),
    url = process.argv[2] || '',
    firstRun = true;

//you can use a string as option
curl.setOpt( 'URL', url );
curl.setOpt( Curl.option.VERBOSE, true );

curl.on( 'end', function ( statusCode, body, headers ) {

    if ( !firstRun )
        throw Error( "Reset didn't worked." );

    firstRun = false;




curl.on( 'error', function ( err, curlErrCode ) {

    console.error( 'Err: ', err );


Jonathan Cardoso Machado [JCM]
Full-stack Web Developer
List admin:
Received on 2014-05-24