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

[jira] Created: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Transfer-Encoding: Chunked on HTTP 1.0 request
----------------------------------------------

                 Key: COUCHDB-40
                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
             Project: CouchDB
          Issue Type: Bug
          Components: HTTP Interface
         Environment: Irrelevant
            Reporter: Kore Nordmann


The following request:

> DELETE /test HTTP/1.0
> Host: localhost

is responded like:

> HTTP/1.0 404 Object Not Found
> Transfer-Encoding: chunked
> Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> Date: Tue, 15 Apr 2008 20:39:07 GMT
> Content-Type: text/plain;charset=utf-8
> 
> 28
> {"error":"not_found","reason":"missing"}
> 0

while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Assigned: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz reassigned COUCHDB-40:
---------------------------------------

    Assignee: Christopher Lenz

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>            Assignee: Christopher Lenz
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594080#action_12594080 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

I have some problem with latest change on OpenBSD -current: I can't ask any more to close the connection 
in http headers ("Connecttion: close"). 
If I do this I get " Connection reset by peer" error. I don't reproduce it on a 2.6.24 linux kernel though. 
Didn't test it yet with freebsd. 


> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Sebastian Probst Eide (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592012#action_12592012 ] 

Sebastian Probst Eide commented on COUCHDB-40:
----------------------------------------------

You are right. It still works on the trunk (r651236).
share/www/script/couch.js has been replaced with a jquery so if one ignores the first half of the patch and only applies the second half, it works perfectly!

Thank you very much!

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593127#action_12593127 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

second patch seem to work. Works well with squid but had some oddities with nginx I didn't solve yet. 
On nginx I have to put keepalive_timeout at 0 to have it working.  It works with this setting. I suspect some
problem with keep-alive so. 

However when I add Content-Length header  on send_json func, everything works like a charm. I will 
do more tests tomorrow.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591989#action_12591989 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

mm patch apply well here on latest trunk (r650977) and was reported to  work on irc :)

patch -p0 -i thepatch in top directory of couchdb sources

You could also use these patches :
http://babilu.metavers.net/couchdb/patches/patch-share_www_script_couch_js
http://babilu.metavers.net/couchdb/patches/patch-src_couchdb_couch_httpd_erl

Same patch but splitted in two for my openbsd port.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Benoit Chesneau updated COUCHDB-40:
-----------------------------------

    Attachment: patch-src_couchdb_couch_httpd_erl

This patch send valid http 1.0 response when you have 1.0 request. I can now post/put/delete doc, remove database. and replicate a database over a proxy. Everything work in HTTP/1.1 with chunks.


This is a work in progress, for now test suite for unknow reason don't  work with such messages :
   1. Exception raised: {"message":"syntax error","fileName":"http://couchdb/_utils/script/json2.js","lineNumber":150,"stack":"()@:0\neval(\"()\")@:0\n(\"\")@http://couchdb/_utils/script/json2.js:150\n()@http://couchdb/_utils/script/couch.js:35\n(undefined)@http://couchdb/_utils/script/couch_tests.js:905\nrun(3)@http://couchdb/_utils/script/couch_tests.js:945\n@:0\n","name":"SyntaxError"}

Firebug show me that DELETE doc is launch 2 times and don't work the second time since the doc don't exist any more. The first delete don't send an ok.

anyway this patch mostly work, I have to have something stable this week-end.



> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz updated COUCHDB-40:
------------------------------------

    Attachment: mochiweb_chunking_http10_2.diff

The first patch against MochiWeb did not work when the client request included
a "Connection: Keep-Alive" header.  This new version fixes that.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz commented on COUCHDB-40:
-----------------------------------------

Are you saying the response requires a Content-Length header to work with those proxies? The change to MochiWeb does not set the content-length, because that would require buffering in all those instances where we actually use chunking, and that would suck.

Instead of the content-length, it relies on the server closing the connection when the last piece of data has been sent. I don't see why that should not work with proper HTTP/1.0 clients.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592021#action_12592021 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

afaik couch.js is still use for test suite. It's needed since a body can't be null on http 1.0 which broke all tests before this patch

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592778#action_12592778 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

this patch work but only when you add the content-length header to http/1.0 request.
I don't know yet if it should be handled by mochiweb or not. I think it should but didn't have time yet to extend your patch for this.  

On the other hand a quick patch on couch_httpd.erl allowed me to confirm that. Patch attached.

Tested on nginx & squid.



> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, patch-share_www_script_jquery_couch_js
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12594230#action_12594230 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

I solve problem of connection reset by peer with a patch against httplib2 :
http://code.google.com/p/httplib2/issues/detail?id=24 . 

The socket wasn't close if you use connection:close header.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589929#action_12589929 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

I can confirm this behaviour. When you use nginx or http proxy wich are http 1.0 proxies, they get chunked http so you can't have proxy over couchdb for now. Tested with this config in nginx :

server {
         listen        80;
         server_name   couchdb;
           location / {
           proxy_pass http://127.0.0.1:5984;
           proxy_redirect off;
           proxy_set_header   Port             $proxy_port;
           proxy_set_header   X-Real-IP        $remote_addr;
           proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
       }
   }


nginx display of course unparsed http chunk. For example on index page :

2e
{"couchdb":"Welcome","version":"0.7.3a648149"}
0

the same with lighttpd :

$HTTP["host"] == "couchdb" {
    server.document-root  = "/var/www/htdocs"
    proxy.server  = ( "" => 
        ((
            "host" => "127.0.0.1",
            "port" => 5984
        ))
    )
}


> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Resolved: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz resolved COUCHDB-40.
-------------------------------------

    Resolution: Fixed

Okay, the Javascript/XHR issues were addressed in r660170, so I think this issue should be fixed.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>            Assignee: Christopher Lenz
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz updated COUCHDB-40:
------------------------------------

    Attachment: mochiweb_chunking_http10.diff

I think it'd be nice if a fix could be done in MochiWeb itself. See this thread:

  http://groups.google.com/group/mochiweb/browse_thread/thread/971a1e70ee9561b9

I'm attaching a patch for you to try. Please report if this fixes the issue (the JS changes will still be necessary), and I'll file a ticket with the patch against the MochiWeb project.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, patch-share_www_script_jquery_couch_js
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Benoit Chesneau updated COUCHDB-40:
-----------------------------------

    Attachment:     (was: patch-src_couchdb_couch_httpd_erl)

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz commented on COUCHDB-40:
-----------------------------------------

As of r 658408 we only use chunked encoding where it's actually needed. Simple responses use no chunked encoding and include a Content-Length header.


> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>            Assignee: Christopher Lenz
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Sebastian Probst Eide (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591815#action_12591815 ] 

Sebastian Probst Eide commented on COUCHDB-40:
----------------------------------------------

Unfortunately the patch doesn't work on the latest trunk version as of writing this...

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Benoit Chesneau updated COUCHDB-40:
-----------------------------------

    Attachment: patch-share_www_script_jquery_couch_js

patch against jquerycouch.js that complete  compat_http10_couchdb_r649048.diff  .  the body shouldn't be null on Post/Put query.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, patch-share_www_script_jquery_couch_js
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Kore Nordmann (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12589241#action_12589241 ] 

Kore Nordmann commented on COUCHDB-40:
--------------------------------------

This happens since the merge of the mochiweb branch, more specifically in revision 648222.

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Sebastian Probst Eide (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592031#action_12592031 ] 

Sebastian Probst Eide commented on COUCHDB-40:
----------------------------------------------

you are right... I must have been really tired, I couldn't find the file.


> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz commented on COUCHDB-40:
-----------------------------------------

The second patch has been accepted into the MochiWeb project, and has been applied to the version in CouchDB trunk in r652206.

About adding a Content-Length header... there are many places (for example view results) where we use start_json_response and Resp:write_chunk instead of just send_json; those are the cases where we'd need to do buffering of the complete response if we wanted to set the Content-Length appropriately. So I'm pretty sure that's not a viable option unless we decide on doing response buffering, which I personally don't think would be a good idea.

Waiting for some more feedback before resolving this. Also, I'd like some details on why those JS changes are necessary. And links, specs, etc?

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Commented: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593246#action_12593246 ] 

Benoit Chesneau commented on COUCHDB-40:
----------------------------------------

Sound goof, did the patch have been tested on all http1/0 proxy ? 

About changes in javascript :

>From the rfc 1945 who define http/1.0 :

   A valid Content-Length is required on all HTTP/1.0 POST requests. An
   HTTP/1.0 server should respond with a 400 (bad request) message if it
   cannot determine the length of the request message's content.


Proxies like nginx are very strict about it. More over nginx don't accept in proxy mode the POST/PUT request without body like a quick search in google would told you.

About content-length :

   When an Entity-Body is included with a message, the length of that
   body may be determined in one of two ways. If a Content-Length header
   field is present, its value in bytes represents the length of the
   Entity-Body. Otherwise, the body length is determined by the closing
   of the connection by the server.

So indeed there is no need to bufferize the response if you close the connection at the end. 
Just better to do it when you can it help the client to optimize the connection. So in the case you could do it like in send_json why not ?

All this stuff need more tests anyway I already provided some results on ml, did you see them ?

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Benoit Chesneau updated COUCHDB-40:
-----------------------------------

    Attachment: compat_http10_couchdb_r649048.diff

New patch that fix all issue i had with previous one. 

Now *couchdb send valid http 1.0 response* (mean no chunks and valid length). Views, attachments, db create/delete, doc create/delete/update work. 

*All tests pass*. Tested over a nginx proxy. 

ok for that ? 

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Benoit Chesneau updated COUCHDB-40:
-----------------------------------

    Attachment: patch-src_couchdb_couch_httpd_erl

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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


[jira] Updated: (COUCHDB-40) Transfer-Encoding: Chunked on HTTP 1.0 request

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

Christopher Lenz updated COUCHDB-40:
------------------------------------

    Fix Version/s: 0.8

> Transfer-Encoding: Chunked on HTTP 1.0 request
> ----------------------------------------------
>
>                 Key: COUCHDB-40
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-40
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>         Environment: Irrelevant
>            Reporter: Kore Nordmann
>            Assignee: Christopher Lenz
>             Fix For: 0.8
>
>         Attachments: compat_http10_couchdb_r649048.diff, mochiweb_chunking_http10.diff, mochiweb_chunking_http10_2.diff, patch-share_www_script_jquery_couch_js, patch-src_couchdb_couch_httpd_erl
>
>
> The following request:
> > DELETE /test HTTP/1.0
> > Host: localhost
> is responded like:
> > HTTP/1.0 404 Object Not Found
> > Transfer-Encoding: chunked
> > Server: MochiWeb/1.0 (Any of you quaids got a smint?)
> > Date: Tue, 15 Apr 2008 20:39:07 GMT
> > Content-Type: text/plain;charset=utf-8
> > 
> > 28
> > {"error":"not_found","reason":"missing"}
> > 0
> while chunked transfer-encoding is only supported by HTTP 1.1.

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