Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAE563355 for ; Thu, 28 Apr 2011 21:07:44 +0000 (UTC) Received: (qmail 53782 invoked by uid 500); 28 Apr 2011 21:07:44 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 53749 invoked by uid 500); 28 Apr 2011 21:07:44 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 53741 invoked by uid 99); 28 Apr 2011 21:07:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 21:07:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Apr 2011 21:07:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 68F28B8351 for ; Thu, 28 Apr 2011 21:07:03 +0000 (UTC) Date: Thu, 28 Apr 2011 21:07:03 +0000 (UTC) From: "Paul Joseph Davis (JIRA)" To: dev@couchdb.apache.org Message-ID: <287309599.9799.1304024823426.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1163894335.41806.1302200766012.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COUCHDB-1123) Longpolling changes feed with filter and accidental Content-Length header stalls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026682#comment-13026682 ] Paul Joseph Davis commented on COUCHDB-1123: -------------------------------------------- First pass at a patch: Index: src/couchdb/couch_httpd.erl =================================================================== --- src/couchdb/couch_httpd.erl (revision 1097601) +++ src/couchdb/couch_httpd.erl (working copy) @@ -170,6 +170,15 @@ handle_request(MochiReq, DefaultFun, UrlHandlers, DbUrlHandlers, DesignUrlHandlers) -> + case {MochiReq:get(method), MochiReq:get(body_length)} of + {'GET', chunked} -> + throw(not_on_my_watch); + {'GET', Len} when is_integer(Len), Len > 0 -> + throw(not_on_my_watch); + _ -> + ok + end, + MochiReq1 = couch_httpd_vhost:dispatch_host(MochiReq), handle_request_int(MochiReq1, DefaultFun, > Longpolling changes feed with filter and accidental Content-Length header stalls > -------------------------------------------------------------------------------- > > Key: COUCHDB-1123 > URL: https://issues.apache.org/jira/browse/COUCHDB-1123 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Affects Versions: 1.0.2 > Environment: Mac OS X Snow Leopard, Ubuntu 10.10. > Reporter: Jyrki Pulliainen > Priority: Minor > Labels: changes, contentlength, couchdb, header, http > > CouchDB behaves erroneously when doing a GET request with Content-Length header to long polling changes feed with filter set. > Easiest way to reproduce: > 1. Create a new DB > 2. Create a single design doc with a filter that just returns true > 3. Query database with curl: curl -v -H "Content-Length: 123" http://localhost:5984/database/_changes?feed=longpoll&filter=designdoc/filter > At this point CouchDB behaves strangely. It does not wait for the client to feed the Content-Length bytes of content (which I think is correct, since GET should not have payload), instead, it returns 200 OK and starts the response with '{"results":['. However, no changes done to database ever get emitted and the connection never gets closed, not even if explicit timeout is set upon the request. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira