Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 856184 Details for
Bug 1058424
[GSS] (6.4.x) JBossWeb does not close connection and also does not disable keep-alive when "Connection: close" specified in response header
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
potential patch / jbossweb-connection-close.patch
jbossweb-connection-close.patch (text/plain), 6.50 KB, created by
Masafumi Miura
on 2014-01-27 18:43:53 UTC
(
hide
)
Description:
potential patch / jbossweb-connection-close.patch
Filename:
MIME Type:
Creator:
Masafumi Miura
Created:
2014-01-27 18:43:53 UTC
Size:
6.50 KB
patch
obsolete
>Index: src/main/java/org/apache/coyote/http11/Http11AprProcessor.java >=================================================================== >--- src/main/java/org/apache/coyote/http11/Http11AprProcessor.java (revision 2356) >+++ src/main/java/org/apache/coyote/http11/Http11AprProcessor.java (working copy) >@@ -69,8 +69,12 @@ > > protected static final boolean CHUNK_ON_CLOSE = > Boolean.valueOf(System.getProperty("org.apache.coyote.http11.Http11Processor.CHUNK_ON_CLOSE", "false")).booleanValue(); >- > >+ // Allow disabling keep-alive by Connection: close header in response >+ protected static final boolean DISABLE_KEEPALIVE_ON_CONCLOSE = >+ Boolean.valueOf(System.getProperty("org.apache.coyote.http11.Http11Processor.DISABLE_KEEPALIVE_ON_CONCLOSE", "false")).booleanValue(); >+ >+ > // ----------------------------------------------------------- Constructors > > >@@ -1367,7 +1371,7 @@ > MimeHeaders headers = request.getMimeHeaders(); > > // Check connection header >- MessageBytes connectionValueMB = headers.getValue("connection"); >+ MessageBytes connectionValueMB = headers.getValue(Constants.CONNECTION); > if (connectionValueMB != null) { > ByteChunk connectionValueBC = connectionValueMB.getByteChunk(); > if (findBytes(connectionValueBC, Constants.CLOSE_BYTES) != -1) { >@@ -1706,6 +1710,13 @@ > } > } > >+ // If we have a Connection: close header, always disable keep-alive >+ boolean connectionClosePresent = false; >+ if(DISABLE_KEEPALIVE_ON_CONCLOSE){ >+ connectionClosePresent = isConnectionClose(headers); >+ keepAlive = keepAlive && !connectionClosePresent; >+ } >+ > long contentLength = response.getContentLengthLong(); > if (contentLength != -1) { > headers.setValue("Content-Length").setLong(contentLength); >@@ -1713,6 +1724,8 @@ > (outputFilters[Constants.IDENTITY_FILTER]); > contentDelimitation = true; > } else { >+ // If the response code supports an entity body and we're on >+ // HTTP 1.1 then we chunk unless we have a Connection: close header > if (entityBody && http11 && (keepAlive || CHUNK_ON_CLOSE)) { > outputBuffer.addActiveFilter > (outputFilters[Constants.CHUNKED_FILTER]); >@@ -1746,7 +1759,11 @@ > // Connection: close header. > keepAlive = keepAlive && !statusDropsConnection(statusCode); > if (!keepAlive) { >- headers.addValue(Constants.CONNECTION).setString(Constants.CLOSE); >+ // Avoid adding the close header twice >+ if (!connectionClosePresent) { >+ headers.addValue(Constants.CONNECTION).setString( >+ Constants.CLOSE); >+ } > } else if (!http11 && !error) { > headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE); > } >@@ -1865,4 +1882,12 @@ > status == 501 /* SC_NOT_IMPLEMENTED */; > } > >+ private boolean isConnectionClose(MimeHeaders headers) { >+ MessageBytes connection = headers.getValue(Constants.CONNECTION); >+ if (connection == null) { >+ return false; >+ } >+ return connection.equals(Constants.CLOSE); >+ } >+ > } >Index: src/main/java/org/apache/coyote/http11/Http11Processor.java >=================================================================== >--- src/main/java/org/apache/coyote/http11/Http11Processor.java (revision 2356) >+++ src/main/java/org/apache/coyote/http11/Http11Processor.java (working copy) >@@ -66,6 +66,10 @@ > protected static final boolean CHUNK_ON_CLOSE = > Boolean.valueOf(System.getProperty("org.apache.coyote.http11.Http11Processor.CHUNK_ON_CLOSE", "false")).booleanValue(); > >+ // Allow disabling keep-alive by Connection: close header in response >+ protected static final boolean DISABLE_KEEPALIVE_ON_CONCLOSE = >+ Boolean.valueOf(System.getProperty("org.apache.coyote.http11.Http11Processor.DISABLE_KEEPALIVE_ON_CONCLOSE", "false")).booleanValue(); >+ > > // ------------------------------------------------------------ Constructor > >@@ -1227,7 +1231,7 @@ > MimeHeaders headers = request.getMimeHeaders(); > > // Check connection header >- MessageBytes connectionValueMB = headers.getValue("connection"); >+ MessageBytes connectionValueMB = headers.getValue(Constants.CONNECTION); > if (connectionValueMB != null) { > ByteChunk connectionValueBC = connectionValueMB.getByteChunk(); > if (findBytes(connectionValueBC, Constants.CLOSE_BYTES) != -1) { >@@ -1555,6 +1559,13 @@ > } > } > >+ // If we have a Connection: close header, always disable keep-alive >+ boolean connectionClosePresent = false; >+ if(DISABLE_KEEPALIVE_ON_CONCLOSE){ >+ connectionClosePresent = isConnectionClose(headers); >+ keepAlive = keepAlive && !connectionClosePresent; >+ } >+ > long contentLength = response.getContentLengthLong(); > if (contentLength != -1) { > headers.setValue("Content-Length").setLong(contentLength); >@@ -1562,6 +1573,8 @@ > (outputFilters[Constants.IDENTITY_FILTER]); > contentDelimitation = true; > } else { >+ // If the response code supports an entity body and we're on >+ // HTTP 1.1 then we chunk unless we have a Connection: close header > if (entityBody && http11 && (keepAlive || CHUNK_ON_CLOSE)) { > outputBuffer.addActiveFilter > (outputFilters[Constants.CHUNKED_FILTER]); >@@ -1595,7 +1608,11 @@ > // Connection: close header. > keepAlive = keepAlive && !statusDropsConnection(statusCode); > if (!keepAlive) { >- headers.addValue(Constants.CONNECTION).setString(Constants.CLOSE); >+ // Avoid adding the close header twice >+ if (!connectionClosePresent) { >+ headers.addValue(Constants.CONNECTION).setString( >+ Constants.CLOSE); >+ } > } else if (!http11 && !error) { > headers.addValue(Constants.CONNECTION).setString(Constants.KEEPALIVE); > } >@@ -1714,4 +1731,12 @@ > status == 501 /* SC_NOT_IMPLEMENTED */; > } > >+ private boolean isConnectionClose(MimeHeaders headers) { >+ MessageBytes connection = headers.getValue(Constants.CONNECTION); >+ if (connection == null) { >+ return false; >+ } >+ return connection.equals(Constants.CLOSE); >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mmiura
: review?
Actions:
View
|
Diff
Attachments on
bug 1058424
: 856184