Merge pull request #10 from kdridi/master
Fix access violation on mac OS X
This commit is contained in:
commit
e796b240da
3 changed files with 16 additions and 7 deletions
|
@ -1,23 +1,32 @@
|
|||
Curl = require('../index');
|
||||
options = {CONNECTTIMEOUT: 2};
|
||||
keys = ["EFFECTIVE_URL", "CONTENT_TYPE", "PRIVATE", "FTP_ENTRY_PATH", "REDIRECT_URL", "PRIMARY_IP", "RTSP_SESSION_ID", "LOCAL_IP"]
|
||||
curl = Curl.create(options)
|
||||
url = 'www.nodejs.org';
|
||||
curl(url, function(err) {
|
||||
console.info("\x1b[33meffetcive url: " + this.info('EFFECTIVE_URL') + "\x1b[0m");
|
||||
self = this
|
||||
keys.forEach(function(key) {
|
||||
console.info("\x1b[33m" + key + ": [" + self.info(key) + "]\x1b[0m");
|
||||
})
|
||||
console.info("body length: " + this.body.length);
|
||||
this.close()
|
||||
});
|
||||
|
||||
curl = Curl.create(options)
|
||||
url = 'www.yahoo.com'
|
||||
curl(url, function(err) {
|
||||
console.info("\x1b[33meffetcive url: " + this.info('EFFECTIVE_URL') + "\x1b[0m");
|
||||
self = this
|
||||
keys.forEach(function(key) {
|
||||
console.info("\x1b[33m" + key + ": [" + self.info(key) + "]\x1b[0m");
|
||||
})
|
||||
console.info("body length: " + this.body.length);
|
||||
this.close()
|
||||
});
|
||||
|
||||
curl = Curl.create(options)
|
||||
curl('https://www.google.com', {VERBOSE: 1, RAW: 1}, function(err) {
|
||||
console.info("\x1b[33meffetcive url: " + this.info('EFFECTIVE_URL') + "\x1b[0m");
|
||||
self = this
|
||||
keys.forEach(function(key) {
|
||||
console.info("\x1b[33m" + key + ": [" + self.info(key) + "]\x1b[0m");
|
||||
})
|
||||
console.info("body length: " + this.body.length);
|
||||
this.close()
|
||||
});
|
||||
|
|
|
@ -155,7 +155,7 @@ class NodeCurl
|
|||
{
|
||||
return raise("curl_easy_getinfo failed", curl_easy_strerror(code));
|
||||
}
|
||||
return JsClass::New(result);
|
||||
return result ? JsClass::New(result) : v8::Null();
|
||||
}
|
||||
|
||||
static v8::Handle<v8::Value> getinfo_int(const v8::Arguments & args)
|
||||
|
|
2
wscript
2
wscript
|
@ -4,7 +4,7 @@ def set_options(opt):
|
|||
def configure(conf):
|
||||
conf.check_tool('compiler_cxx')
|
||||
conf.check_tool('node_addon')
|
||||
conf.env.append_unique('CXXFLAGS', ['-Wall', '-O2'])
|
||||
conf.env.append_unique('CXXFLAGS', ['-Wall', '-O2', '-fno-inline-functions'])
|
||||
conf.env['LIB_CURL'] = 'curl'
|
||||
|
||||
def build(bld):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue