You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by ji...@apache.org on 2004/04/17 18:19:32 UTC

[jira] Updated: (CACTUS-17) Cactus client doesn't handle Chunked-Transfer-Encoding

The following issue has been updated:

    Updater: Vincent Massol (mailto:vmassol@apache.org)
       Date: Sat, 17 Apr 2004 9:18 AM
    Changes:
             description changed from [Using Cactus 1.2 - It wasn't a choice in the "Version" select list of the bug
reporting page.]

Currently, the AutoReadHttpURLConnection used by the Cactus client does not
properly handle responses from servers which use Chunked-Transfer-Encoding (HTTP
1.1). The result is that Cactus tests hang (block until timeout on socket reads). 

This is due to logic in the copy() method, which looks for a Content-Length
header and, if one is not found, assumes that socket reads will not block. This
is a faulty assumption in the case of servers that use
Chunked-Transfer-Encoding, which allows for persistent connections despite the
fact that the resource size is not known in advance. In this case, the server
must not send a Content-Length header (as mandated in the HTTP 1.1 spec). Yet
because the connections are persistent, read() blocks.

There are two possible ways to fix this problem:

1) Make AutoReadHttpURLConnection properly handle Chunked-Transfer-Encoding. CTE
 provides a clear mark at the end of the entity, so this is matter of
recognizing this mark and closing the connection.

2) Add a "Connection: close" header to the request made by the Cactus client.
This will signal to the server that it should close the connection after the
response has been sent, in which case read() will NOT block, making the
assumption above valid again.

1) is preferable but 2) is probably easier. to [Using Cactus 1.2 - It wasn't a choice in the "Version" select list of the bug
reporting page.]

Currently, the AutoReadHttpURLConnection used by the Cactus client does not
properly handle responses from servers which use Chunked-Transfer-Encoding (HTTP
1.1). The result is that Cactus tests hang (block until timeout on socket reads). 

This is due to logic in the copy() method, which looks for a Content-Length
header and, if one is not found, assumes that socket reads will not block. This
is a faulty assumption in the case of servers that use
Chunked-Transfer-Encoding, which allows for persistent connections despite the
fact that the resource size is not known in advance. In this case, the server
must not send a Content-Length header (as mandated in the HTTP 1.1 spec). Yet
because the connections are persistent, read() blocks.

There are two possible ways to fix this problem:

1) Make AutoReadHttpURLConnection properly handle Chunked-Transfer-Encoding. CTE
 provides a clear mark at the end of the entity, so this is matter of
recognizing this mark and closing the connection.

2) Add a "Connection: close" header to the request made by the Cactus client.
This will signal to the server that it should close the connection after the
response has been sent, in which case read() will NOT block, making the
assumption above valid again.

1) is preferable but 2) is probably easier.
             environment changed from Operating System: All
Platform: All to Operating System: All
Platform: All
             priority changed to Major
             Fix Version changed to 1.3
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/CACTUS-17?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/CACTUS-17

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: CACTUS-17
    Summary: Cactus client doesn't handle Chunked-Transfer-Encoding
       Type: Bug

     Status: Reopened
   Priority: Major

    Project: Cactus
 Components: 
             Framework
   Fix Fors:
             1.3

   Assignee: Vincent Massol
   Reporter: Ryan Shaw

    Created: Thu, 7 Mar 2002 2:12 AM
    Updated: Sat, 17 Apr 2004 9:18 AM
Environment: Operating System: All
Platform: All

Description:
[Using Cactus 1.2 - It wasn't a choice in the "Version" select list of the bug
reporting page.]

Currently, the AutoReadHttpURLConnection used by the Cactus client does not
properly handle responses from servers which use Chunked-Transfer-Encoding (HTTP
1.1). The result is that Cactus tests hang (block until timeout on socket reads). 

This is due to logic in the copy() method, which looks for a Content-Length
header and, if one is not found, assumes that socket reads will not block. This
is a faulty assumption in the case of servers that use
Chunked-Transfer-Encoding, which allows for persistent connections despite the
fact that the resource size is not known in advance. In this case, the server
must not send a Content-Length header (as mandated in the HTTP 1.1 spec). Yet
because the connections are persistent, read() blocks.

There are two possible ways to fix this problem:

1) Make AutoReadHttpURLConnection properly handle Chunked-Transfer-Encoding. CTE
 provides a clear mark at the end of the entity, so this is matter of
recognizing this mark and closing the connection.

2) Add a "Connection: close" header to the request made by the Cactus client.
This will signal to the server that it should close the connection after the
response has been sent, in which case read() will NOT block, making the
assumption above valid again.

1) is preferable but 2) is probably easier.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org