couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Newson (JIRA)" <>
Subject [jira] Reopened: (COUCHDB-595) Expect/Continue support broken for non-chunked transfer uploads
Date Fri, 18 Dec 2009 20:31:18 GMT


Robert Newson reopened COUCHDB-595:

Below is a script to reproduce the problem. 

Curl sends this;

> PUT /db1/doc1/att HTTP/1.1
> User-Agent: curl/7.19.4 (universal-apple-darwin10.0) libcurl/7.19.4 OpenSSL/0.9.8k zlib/1.2.3
> Host: localhost:5984
> Accept: */*
> Content-Length: 61440
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue

at this point, curl waits for COUCHDB to send;


But couchdb never sends this.

Curl, after a couple of seconds, gives up waiting and sends the body anyway. Once this is
sent, CouchDB responds with;

* Done waiting for 100-continue
< HTTP/1.1 201 Created
< Server: CouchDB/0.11.0b22c551bb-git (Erlang OTP/R13B)
< Location: http://localhost:5984/db1/doc1/att
< Date: Fri, 18 Dec 2009 20:26:38 GMT
< Content-Type: text/plain;charset=utf-8
< Content-Length: 67
< Cache-Control: must-revalidate

The fix is to immediately return "HTTP/1.1 100 CONTINUE" on receipt of the end of headers
(the \r\n\r\n sequence) or a final error code, if the client included an Expect: 100-continue



dd if=/dev/zero of=att bs=60k count=1

curl -X DELETE $URL/db1
curl -X PUT $URL/db1

for COUNT in {0..100000}
  curl -X PUT -d '{"text":"some text goes here, oh yes."}' $URL/db1/doc$((COUNT * 2))
  curl -v -X PUT --data-binary @att $URL/db1/doc$((COUNT * 2 + 1))/att

> Expect/Continue support broken for non-chunked transfer uploads
> ---------------------------------------------------------------
>                 Key: COUCHDB-595
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>            Reporter: Robert Newson
> CouchDB does not send the "HTTP/1.1 100 CONTINUE\r\n" line in response to a request with
header "Expect: 100-continue". It does do so for chunked transfer mode, so correct expect/continue
behavior can be achieved by forcing chunked mode, even when the exact length of the body is
> mochiweb_request.erl's recv/1 method does not send the header, but stream_body/4 does.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message