couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoit Chesneau (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-595) Expect/Continue support broken for non-chunked transfer uploads
Date Fri, 18 Dec 2009 21:00:18 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792639#action_12792639
] 

Benoit Chesneau commented on COUCHDB-595:
-----------------------------------------

Closer look on it using raw socket calls :

http://friendpaste.com/4dbdw6pscRwNHoxpswklUH (paste below) 

So it appears the problem happen only on attachment sending. Also I notice there me another
problem here. When you send a conflicted doc the first time you get a connection reset per
peer :


>>> sock = socket.create_connection(("127.0.0.1", 5984))>>> sock.send('PUT
/testdb/hum1 HTTP/1.1\r\nHost: 127.0.0.1:5984\r\nAccept-Encoding: identity\r\nContent-Length:
2\r\nContent-Type: application/octet-stream\r\nExpect: 100-continue\r\nUser-Agent: restkit/0.9.2\r\n\r\n')
186
>>> sock.recv(4096)'HTTP/1.1 100 Continue\r\n\r\n'
>>> sock.send("{}")2
>>> sock.recv(4096)'HTTP/1.1 201 Created\r\nServer: CouchDB/0.11.0b22c551bb-git (Erlang
OTP/R13B)\r\nLocation: http://127.0.0.1:5984/testdb/hum1\r\nEtag: "1-967a00dff5e02add41819138abb3284d"\r\nDate:
Fri, 18 Dec 2009 20:49:48 GMT\r\nContent-Type: text/plain;charset=utf-8\r\nContent-Length:
67\r\nCache-Control: must-revalidate\r\n\r\n{"ok":true,"id":"hum1","rev":"1-967a00dff5e02add41819138abb3284d"}\n'
>>> sock = socket.create_connection(("127.0.0.1", 5984))>>> sock.send('PUT
/testdb/hum1/att1 HTTP/1.1\r\nHost: 127.0.0.1:5984\r\nAccept-Encoding: identity\r\nContent-Length:
2\r\nContent-Type: application/octet-stream\r\nExpect: 100-continue\r\nUser-Agent: restkit/0.9.2\r\n\r\n')
191
>>> sock.recv(4096)
'HTTP/1.1 409 Conflict\r\nServer: CouchDB/0.11.0b22c551bb-git (Erlang OTP/R13B)\r\nDate: Fri,
18 Dec 2009 20:50:22 GMT\r\nContent-Type: text/plain;charset=utf-8\r\nContent-Length: 58\r\nCache-Control:
must-revalidate\r\n\r\n{"error":"conflict","reason":"Document update conflict."}\n'
>>> sock = socket.create_connection(("127.0.0.1", 5984))>>> sock.send('PUT
/testdb/hum1/att1?rev=1-967a00dff5e02add41819138abb3284d HTTP/1.1\r\nHost: 127.0.0.1:5984\r\nAccept-Encoding:
identity\r\nContent-Length: 2\r\nContent-Type: application/octet-stream\r\nExpect: 100-continue\r\nUser-Agent:
restkit/0.9.2\r\n\r\n')
230
>>> sock.recv(4096)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.error: [Errno 54] Connection reset by peer
>>> sock = socket.create_connection(("127.0.0.1", 5984), 2)>>> sock.send('PUT
/testdb/hum1/att1?rev=1-967a00dff5e02add41819138abb3284d HTTP/1.1\r\nHost: 127.0.0.1:5984\r\nAccept-Encoding:
identity\r\nContent-Length: 2\r\nContent-Type: application/octet-stream\r\nExpect: 100-continue\r\nUser-Agent:
restkit/0.9.2\r\n\r\n')
230
>>> sock.recv(4096)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.timeout: timed out

> Expect/Continue support broken for non-chunked transfer uploads
> ---------------------------------------------------------------
>
>                 Key: COUCHDB-595
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-595
>             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
known.
> 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.


Mime
View raw message