diff options
author | Jan Lehnardt <jan@apache.org> | 2009-01-24 11:48:42 +0000 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2009-01-24 11:48:42 +0000 |
commit | 2422ad8d97483b908b339c0b5619e73868a1fdc7 (patch) | |
tree | 9780ce95396c7b48df29fbdd008525729f3effa4 /src | |
parent | d35cbb3032767ebe2632b9be69f1b88f8522639e (diff) |
Make command line test suite succeed again. Patch by Bob Dionne.
Closes COUCHDB-212. Thanks Bob.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@737335 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/couchdb/couch_js.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/couchdb/couch_js.c b/src/couchdb/couch_js.c index a23eb5c8..a6fbde60 100644 --- a/src/couchdb/couch_js.c +++ b/src/couchdb/couch_js.c @@ -616,6 +616,7 @@ GetHttp(JSContext *context, JSObject *obj, uintN argc, jsval *argv, jsval *rval) curl_easy_setopt(handle,CURLOPT_WRITEHEADER,b); curl_easy_setopt(handle,CURLOPT_URL,url); curl_easy_setopt(handle,CURLOPT_HTTPGET,1); + curl_easy_setopt(handle,CURLOPT_FOLLOWLOCATION,1); curl_easy_setopt(handle,CURLOPT_NOPROGRESS,1); curl_easy_setopt(handle,CURLOPT_IPRESOLVE,CURL_IPRESOLVE_V4); @@ -864,8 +865,12 @@ PutHttp(JSContext *context, JSObject *obj, uintN argc, jsval *argv, jsval *rval) b_data->pos = 0; data = JSValToChar(context,(argv+1)); + readlen = strlen(data); + + + // TODO: remove strlen - append_Buffer(b_data->buffer,data,strlen(data)); + append_Buffer(b_data->buffer,data,readlen); free(data); @@ -887,6 +892,9 @@ PutHttp(JSContext *context, JSObject *obj, uintN argc, jsval *argv, jsval *rval) curl_easy_setopt(handle,CURLOPT_READDATA,b_data); curl_easy_setopt(handle,CURLOPT_URL,url); curl_easy_setopt(handle,CURLOPT_UPLOAD,1); + curl_easy_setopt(handle,CURLOPT_INFILESIZE,readlen); + + // Curl structure struct curl_slist *slist = generateCurlHeaders(context,argv+2); @@ -900,6 +908,8 @@ PutHttp(JSContext *context, JSObject *obj, uintN argc, jsval *argv, jsval *rval) // Use only ipv4 curl_easy_setopt(handle,CURLOPT_IPRESOLVE,CURL_IPRESOLVE_V4); + + // Perform int exitcode; |