Rename effective_options to effectiveOptions.

This commit is contained in:
Miao Jiang 2012-11-29 17:03:12 +08:00
parent a21831a17e
commit 5dc00f43dc
2 changed files with 17 additions and 15 deletions

View file

@ -39,7 +39,7 @@
var args, c, cb, k, length, v, _ref, _ref1, _ref2, _ref3, _ref4;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
if (this.running) {
throw new Error('the cURL session is busy, use CurlBuilder.create to create another cURL Session');
throw new Error('the cURL session is busy, use curl.create to create another cURL Session');
}
if (!this.curl_) {
throw new Error('the cURL is closed.');
@ -54,19 +54,21 @@
c.chunks = [];
length = 0;
this.debug = (_ref1 = (_ref2 = this.defaultOptions.DEBUG) != null ? _ref2 : this.options.DEBUG) != null ? _ref1 : this.debug;
this.effective_options = {};
this.effectiveOptions = {};
_ref3 = this.defaultOptions;
for (k in _ref3) {
v = _ref3[k];
this.effective_options[k] = v;
this.effectiveOptions[k] = v;
}
_ref4 = this.options;
for (k in _ref4) {
v = _ref4[k];
this.effective_options[k] = v;
this.effectiveOptions[k] = v;
}
this.setOptions(this.effective_options);
this.curl_.setopt('URL', this.url);
this.setOptions(this.effectiveOptions);
this.setOptions({
URL: this.url
});
c.on_write = function(chunk) {
curl.log("receive " + chunk.length + " bytes");
c.chunks.push(chunk);
@ -114,7 +116,7 @@
if (reset == null) {
reset = true;
}
this.defaultOptions = options;
defaultOptions = options;
if (reset) {
this.log('Set default options and reset cURL');
return this.reset();