You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Shahar Evron (JIRA)" <ji...@apache.org> on 2008/04/17 22:33:21 UTC

[jira] Created: (COUCHDB-42) Sending "Content-length: 0" in PUT requests causes connection to close

Sending "Content-length: 0" in PUT requests causes connection to close
----------------------------------------------------------------------

                 Key: COUCHDB-42
                 URL: https://issues.apache.org/jira/browse/COUCHDB-42
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
         Environment: Linux/Gentoo i386, glibc 2.7

            Reporter: Shahar Evron


CouchDb built from trunk rev. 649048

When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).

For example from telnet:
{code}
$ telnet localhost 5984
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
PUT /test_db HTTP/1.1
Host: localhost

HTTP/1.1 201 Created
Transfer-Encoding: chunked
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Thu, 17 Apr 2008 20:33:40 GMT
Content-Type: text/plain;charset=utf-8

b
{"ok":true}
0
{code}
In the above example the connection is not closed and all is fine.  However:
{code}
PUT /test_db2 HTTP/1.1
Host: localhost
Content-length: 0

HTTP/1.1 201 Created
Transfer-Encoding: chunked
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Thu, 17 Apr 2008 20:33:59 GMT
Content-Type: text/plain;charset=utf-8

b
{"ok":true}
0

Connection closed by foreign host.
{code}


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


[jira] Updated: (COUCHDB-42) Sending "Content-length: 0" in PUT requests causes connection to close

Posted by "Shahar Evron (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shahar Evron updated COUCHDB-42:
--------------------------------

    Description: 
CouchDb built from trunk rev. 649048

When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).

For example from telnet:
---- code ----
$ telnet localhost 5984
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
PUT /test_db HTTP/1.1
Host: localhost

HTTP/1.1 201 Created
Transfer-Encoding: chunked
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Thu, 17 Apr 2008 20:33:40 GMT
Content-Type: text/plain;charset=utf-8

b
{"ok":true}
0
---- end code ----

In the above example the connection is not closed and all is fine.  However:

---- code ----
PUT /test_db2 HTTP/1.1
Host: localhost
Content-length: 0

HTTP/1.1 201 Created
Transfer-Encoding: chunked
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Thu, 17 Apr 2008 20:33:59 GMT
Content-Type: text/plain;charset=utf-8

b
{"ok":true}
0

Connection closed by foreign host.
---- end code ----


  was:
CouchDb built from trunk rev. 649048

When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).

For example from telnet:
{code}
$ telnet localhost 5984
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
PUT /test_db HTTP/1.1
Host: localhost

HTTP/1.1 201 Created
Transfer-Encoding: chunked
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Thu, 17 Apr 2008 20:33:40 GMT
Content-Type: text/plain;charset=utf-8

b
{"ok":true}
0
{code}
In the above example the connection is not closed and all is fine.  However:
{code}
PUT /test_db2 HTTP/1.1
Host: localhost
Content-length: 0

HTTP/1.1 201 Created
Transfer-Encoding: chunked
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Thu, 17 Apr 2008 20:33:59 GMT
Content-Type: text/plain;charset=utf-8

b
{"ok":true}
0

Connection closed by foreign host.
{code}



> Sending "Content-length: 0" in PUT requests causes connection to close
> ----------------------------------------------------------------------
>
>                 Key: COUCHDB-42
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-42
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Linux/Gentoo i386, glibc 2.7
>            Reporter: Shahar Evron
>
> CouchDb built from trunk rev. 649048
> When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).
> For example from telnet:
> ---- code ----
> $ telnet localhost 5984
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> PUT /test_db HTTP/1.1
> Host: localhost
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:40 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> ---- end code ----
> In the above example the connection is not closed and all is fine.  However:
> ---- code ----
> PUT /test_db2 HTTP/1.1
> Host: localhost
> Content-length: 0
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:59 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> Connection closed by foreign host.
> ---- end code ----

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


[jira] Assigned: (COUCHDB-42) Sending "Content-length: 0" in PUT requests causes connection to close

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz reassigned COUCHDB-42:
---------------------------------------

    Assignee: Christopher Lenz

> Sending "Content-length: 0" in PUT requests causes connection to close
> ----------------------------------------------------------------------
>
>                 Key: COUCHDB-42
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-42
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Linux/Gentoo i386, glibc 2.7
>            Reporter: Shahar Evron
>            Assignee: Christopher Lenz
>
> CouchDb built from trunk rev. 649048
> When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).
> For example from telnet:
> ---- code ----
> $ telnet localhost 5984
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> PUT /test_db HTTP/1.1
> Host: localhost
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:40 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> ---- end code ----
> In the above example the connection is not closed and all is fine.  However:
> ---- code ----
> PUT /test_db2 HTTP/1.1
> Host: localhost
> Content-length: 0
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:59 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> Connection closed by foreign host.
> ---- end code ----

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


[jira] Commented: (COUCHDB-42) Sending "Content-length: 0" in PUT requests causes connection to close

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599733#action_12599733 ] 

Christopher Lenz commented on COUCHDB-42:
-----------------------------------------

Filed a bug against MochiWeb, including a patch:

  http://code.google.com/p/mochiweb/issues/detail?id=12

> Sending "Content-length: 0" in PUT requests causes connection to close
> ----------------------------------------------------------------------
>
>                 Key: COUCHDB-42
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-42
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Linux/Gentoo i386, glibc 2.7
>            Reporter: Shahar Evron
>            Assignee: Christopher Lenz
>
> CouchDb built from trunk rev. 649048
> When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).
> For example from telnet:
> ---- code ----
> $ telnet localhost 5984
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> PUT /test_db HTTP/1.1
> Host: localhost
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:40 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> ---- end code ----
> In the above example the connection is not closed and all is fine.  However:
> ---- code ----
> PUT /test_db2 HTTP/1.1
> Host: localhost
> Content-length: 0
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:59 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> Connection closed by foreign host.
> ---- end code ----

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


[jira] Resolved: (COUCHDB-42) Sending "Content-length: 0" in PUT requests causes connection to close

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz resolved COUCHDB-42.
-------------------------------------

    Resolution: Fixed

Should be fixed by r660136.

> Sending "Content-length: 0" in PUT requests causes connection to close
> ----------------------------------------------------------------------
>
>                 Key: COUCHDB-42
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-42
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Linux/Gentoo i386, glibc 2.7
>            Reporter: Shahar Evron
>            Assignee: Christopher Lenz
>
> CouchDb built from trunk rev. 649048
> When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).
> For example from telnet:
> ---- code ----
> $ telnet localhost 5984
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> PUT /test_db HTTP/1.1
> Host: localhost
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:40 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> ---- end code ----
> In the above example the connection is not closed and all is fine.  However:
> ---- code ----
> PUT /test_db2 HTTP/1.1
> Host: localhost
> Content-length: 0
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:59 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> Connection closed by foreign host.
> ---- end code ----

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


[jira] Updated: (COUCHDB-42) Sending "Content-length: 0" in PUT requests causes connection to close

Posted by "Christopher Lenz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christopher Lenz updated COUCHDB-42:
------------------------------------

    Fix Version/s: 0.8

> Sending "Content-length: 0" in PUT requests causes connection to close
> ----------------------------------------------------------------------
>
>                 Key: COUCHDB-42
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-42
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Linux/Gentoo i386, glibc 2.7
>            Reporter: Shahar Evron
>            Assignee: Christopher Lenz
>             Fix For: 0.8
>
>
> CouchDb built from trunk rev. 649048
> When sending a PUT request with no body and "Content-length: 0" header, the connection is closed by the HTTP server after the response is received. This happens when creating a new DB for example (no body is sent).
> For example from telnet:
> ---- code ----
> $ telnet localhost 5984
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> PUT /test_db HTTP/1.1
> Host: localhost
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:40 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> ---- end code ----
> In the above example the connection is not closed and all is fine.  However:
> ---- code ----
> PUT /test_db2 HTTP/1.1
> Host: localhost
> Content-length: 0
> HTTP/1.1 201 Created
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Thu, 17 Apr 2008 20:33:59 GMT
> Content-Type: text/plain;charset=utf-8
> b
> {"ok":true}
> 0
> Connection closed by foreign host.
> ---- end code ----

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