You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Steffen Pingel (JIRA)" <ji...@apache.org> on 2007/07/17 22:53:04 UTC
[jira] Created: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
DefaultNHttpServerConnection.consumeInput() stops reading
---------------------------------------------------------
Key: HTTPCORE-103
URL: https://issues.apache.org/jira/browse/HTTPCORE-103
Project: HttpComponents Core
Issue Type: Bug
Components: HttpCore NIO
Affects Versions: 4.0-alpha5
Reporter: Steffen Pingel
If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
int bytesRead;
while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
if (bytesRead > 0) {
this.inTransportMetrics.incrementBytesTransferred(bytesRead);
}
this.request = (HttpRequest) this.requestParser.parse();
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Updated: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
Posted by "Steffen Pingel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steffen Pingel updated HTTPCORE-103:
------------------------------------
Attachment: httpcore-greedy-message-parsing.patch
I found some problems with the previous patch while running our integration tests. I have attached an updated patch.
> DefaultNHttpServerConnection.consumeInput() stops reading
> ---------------------------------------------------------
>
> Key: HTTPCORE-103
> URL: https://issues.apache.org/jira/browse/HTTPCORE-103
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Steffen Pingel
> Fix For: 4.0-beta1
>
> Attachments: httpcore-greedy-message-parsing.patch, httpcore-greedy-message-parsing.patch, TestBaseIOReactorSSL.java
>
>
> If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
> int bytesRead;
> while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
> if (bytesRead > 0) {
> this.inTransportMetrics.incrementBytesTransferred(bytesRead);
> }
> this.request = (HttpRequest) this.requestParser.parse();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Updated: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
Posted by "Steffen Pingel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steffen Pingel updated HTTPCORE-103:
------------------------------------
Attachment: httpcore-greedy-message-parsing.patch
Patch that changes message parsing as described for client and server connections.
> DefaultNHttpServerConnection.consumeInput() stops reading
> ---------------------------------------------------------
>
> Key: HTTPCORE-103
> URL: https://issues.apache.org/jira/browse/HTTPCORE-103
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Steffen Pingel
> Fix For: 4.0-beta1
>
> Attachments: TestBaseIOReactorSSL.java
>
>
> If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
> int bytesRead;
> while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
> if (bytesRead > 0) {
> this.inTransportMetrics.incrementBytesTransferred(bytesRead);
> }
> this.request = (HttpRequest) this.requestParser.parse();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Updated: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
Posted by "Steffen Pingel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steffen Pingel updated HTTPCORE-103:
------------------------------------
Attachment: (was: httpcore-greedy-message-parsing.patch)
> DefaultNHttpServerConnection.consumeInput() stops reading
> ---------------------------------------------------------
>
> Key: HTTPCORE-103
> URL: https://issues.apache.org/jira/browse/HTTPCORE-103
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Steffen Pingel
> Fix For: 4.0-beta1
>
> Attachments: TestBaseIOReactorSSL.java
>
>
> If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
> int bytesRead;
> while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
> if (bytesRead > 0) {
> this.inTransportMetrics.incrementBytesTransferred(bytesRead);
> }
> this.request = (HttpRequest) this.requestParser.parse();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Updated: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
Posted by "Steffen Pingel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steffen Pingel updated HTTPCORE-103:
------------------------------------
Attachment: TestBaseIOReactorSSL.java
Test case that demonstrates that parsing the request takes longer than 500 ms due to data being buffered in the underlying SSLIOSession.
> DefaultNHttpServerConnection.consumeInput() stops reading
> ---------------------------------------------------------
>
> Key: HTTPCORE-103
> URL: https://issues.apache.org/jira/browse/HTTPCORE-103
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Steffen Pingel
> Attachments: TestBaseIOReactorSSL.java
>
>
> If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
> int bytesRead;
> while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
> if (bytesRead > 0) {
> this.inTransportMetrics.incrementBytesTransferred(bytesRead);
> }
> this.request = (HttpRequest) this.requestParser.parse();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Updated: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski updated HTTPCORE-103:
---------------------------------------
Fix Version/s: 4.0-beta1
Makes sense. I think similar change need to be made to DefaultNHttpClientConnection.
Oleg
> DefaultNHttpServerConnection.consumeInput() stops reading
> ---------------------------------------------------------
>
> Key: HTTPCORE-103
> URL: https://issues.apache.org/jira/browse/HTTPCORE-103
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Steffen Pingel
> Fix For: 4.0-beta1
>
> Attachments: TestBaseIOReactorSSL.java
>
>
> If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
> int bytesRead;
> while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
> if (bytesRead > 0) {
> this.inTransportMetrics.incrementBytesTransferred(bytesRead);
> }
> this.request = (HttpRequest) this.requestParser.parse();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Updated: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
Posted by "Steffen Pingel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steffen Pingel updated HTTPCORE-103:
------------------------------------
Attachment: httpcore-greedy-message-parsing.patch
> DefaultNHttpServerConnection.consumeInput() stops reading
> ---------------------------------------------------------
>
> Key: HTTPCORE-103
> URL: https://issues.apache.org/jira/browse/HTTPCORE-103
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Steffen Pingel
> Fix For: 4.0-beta1
>
> Attachments: httpcore-greedy-message-parsing.patch, TestBaseIOReactorSSL.java
>
>
> If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
> int bytesRead;
> while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
> if (bytesRead > 0) {
> this.inTransportMetrics.incrementBytesTransferred(bytesRead);
> }
> this.request = (HttpRequest) this.requestParser.parse();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
[jira] Resolved: (HTTPCORE-103)
DefaultNHttpServerConnection.consumeInput() stops reading
Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HTTPCORE-103?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Oleg Kalnichevski resolved HTTPCORE-103.
----------------------------------------
Resolution: Fixed
Patch checked in. Many thanks, Steffen
Oleg
> DefaultNHttpServerConnection.consumeInput() stops reading
> ---------------------------------------------------------
>
> Key: HTTPCORE-103
> URL: https://issues.apache.org/jira/browse/HTTPCORE-103
> Project: HttpComponents Core
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.0-alpha5
> Reporter: Steffen Pingel
> Fix For: 4.0-beta1
>
> Attachments: httpcore-greedy-message-parsing.patch, httpcore-greedy-message-parsing.patch, TestBaseIOReactorSSL.java
>
>
> If the underlying channel has more data buffered than can be read into inbuf DefaultNHttpServerConnection.consumeInput() will return and relies on the selector to timeout to read the remaining part of the request. I suggest to make the parsing code more greedy:
> int bytesRead;
> while ((bytesRead = this.requestParser.fillBuffer(this.session.channel())) > 0 && this.request == null) {
> if (bytesRead > 0) {
> this.inTransportMetrics.incrementBytesTransferred(bytesRead);
> }
> this.request = (HttpRequest) this.requestParser.parse();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org