You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Roland Weber (JIRA)" <ji...@apache.org> on 2007/07/29 21:53:52 UTC

[jira] Created: (HTTPCORE-106) factor out HTTP parsing

factor out HTTP parsing
-----------------------

                 Key: HTTPCORE-106
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-106
             Project: HttpComponents Core
          Issue Type: Improvement
          Components: HttpCore
    Affects Versions: 4.0-alpha5
            Reporter: Roland Weber
             Fix For: 4.0-alpha6


HTTP parsing in HttpCore/main is currently implemented directly in the connection classes. To simplify replacing the parser, this code should be factored out into separate class (request/response), accessible via HttpParser interfaces. HttpNIO already has such interfaces.


-- 
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] Commented: (HTTPCORE-106) factor out HTTP parsing

Posted by "Roland Weber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516946 ] 

Roland Weber commented on HTTPCORE-106:
---------------------------------------

Hi Oleg,

take your time. We might also handle the formatting as part of HTTPCORE-107.

cheers,
  Roland


> factor out HTTP parsing
> -----------------------
>
>                 Key: HTTPCORE-106
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-106
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha5
>            Reporter: Roland Weber
>            Assignee: Oleg Kalnichevski
>             Fix For: 4.0-alpha6
>
>
> HTTP parsing in HttpCore/main is currently implemented directly in the connection classes. To simplify replacing the parser, this code should be factored out into separate class (request/response), accessible via HttpParser interfaces. HttpNIO already has such interfaces.

-- 
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] Assigned: (HTTPCORE-106) factor out HTTP parsing

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

Oleg Kalnichevski reassigned HTTPCORE-106:
------------------------------------------

    Assignee: Oleg Kalnichevski

> factor out HTTP parsing
> -----------------------
>
>                 Key: HTTPCORE-106
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-106
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha5
>            Reporter: Roland Weber
>            Assignee: Oleg Kalnichevski
>             Fix For: 4.0-alpha6
>
>
> HTTP parsing in HttpCore/main is currently implemented directly in the connection classes. To simplify replacing the parser, this code should be factored out into separate class (request/response), accessible via HttpParser interfaces. HttpNIO already has such interfaces.

-- 
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] Commented: (HTTPCORE-106) factor out HTTP parsing

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517582 ] 

Oleg Kalnichevski commented on HTTPCORE-106:
--------------------------------------------

Roland

I made the following changes to HttpCore NIO:

* Introduced NHttpMessageParser and NHttpMessageWriter interfaces for non-blocking connections
* Factored out HTTP message parsing and writing code into separate classes making it possible to plug in an alternative implementation of those classes
* Added protected factory methods for instantiating HTTP message parser and writer

Please take a look. If I hear no objections, I'll make similar changes to HttpCore main later this weekend.

Oleg

> factor out HTTP parsing
> -----------------------
>
>                 Key: HTTPCORE-106
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-106
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha5
>            Reporter: Roland Weber
>            Assignee: Oleg Kalnichevski
>             Fix For: 4.0-alpha6
>
>
> HTTP parsing in HttpCore/main is currently implemented directly in the connection classes. To simplify replacing the parser, this code should be factored out into separate class (request/response), accessible via HttpParser interfaces. HttpNIO already has such interfaces.

-- 
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] Commented: (HTTPCORE-106) factor out HTTP parsing

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516919 ] 

Oleg Kalnichevski commented on HTTPCORE-106:
--------------------------------------------

This one will take quite a bit more work that I initially anticipated, as we will have to go through the same exercise for HTTP formatting code as well. I will only be able to complete the work on the weekend.

Oleg

> factor out HTTP parsing
> -----------------------
>
>                 Key: HTTPCORE-106
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-106
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha5
>            Reporter: Roland Weber
>            Assignee: Oleg Kalnichevski
>             Fix For: 4.0-alpha6
>
>
> HTTP parsing in HttpCore/main is currently implemented directly in the connection classes. To simplify replacing the parser, this code should be factored out into separate class (request/response), accessible via HttpParser interfaces. HttpNIO already has such interfaces.

-- 
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


Re: [jira] Resolved: (HTTPCORE-106) factor out HTTP parsing

Posted by Roland Weber <os...@dubioso.net>.
Oleg Kalnichevski wrote:
>> Why separate? If a parser can be used for both request and
>> reply, using it for only one of them should be fine, right?
> 
> Right, but at the price of maintaining more state information then
> necessary. As always, feel free to do it differently. I will not stand
> in your way.

I'll think it over, and I'll have a good look at both
traditional IO and NIO. Depending on how much code is
re-used, separate frameworks may indeed be an option.

thanks,
  Roland


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


Re: [jira] Resolved: (HTTPCORE-106) factor out HTTP parsing

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2007-08-06 at 17:52 +0200, Roland Weber wrote:
> Oleg Kalnichevski wrote:
> >> Would such changes in core interfere with NIO?
> > 
> > I am afraid so, as NIO parsers have got to be stateful. They need to
> > maintain state as message heads may be transmitted in multiple
> > incomplete chunks.
> 
> I see, thanks.
> 
> > So, we either have to have a completely different
> > message parsing frameworks for HttpCore main and HttpCore NIO or keep
> > request / response parsers stateful and separate.
> 
> Why separate? If a parser can be used for both request and
> reply, using it for only one of them should be fine, right?
> 

Right, but at the price of maintaining more state information then
necessary. As always, feel free to do it differently. I will not stand
in your way.

Oleg

> cheers,
>   Roland
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


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


Re: [jira] Resolved: (HTTPCORE-106) factor out HTTP parsing

Posted by Roland Weber <os...@dubioso.net>.
Oleg Kalnichevski wrote:
>> Would such changes in core interfere with NIO?
> 
> I am afraid so, as NIO parsers have got to be stateful. They need to
> maintain state as message heads may be transmitted in multiple
> incomplete chunks.

I see, thanks.

> So, we either have to have a completely different
> message parsing frameworks for HttpCore main and HttpCore NIO or keep
> request / response parsers stateful and separate.

Why separate? If a parser can be used for both request and
reply, using it for only one of them should be fine, right?

cheers,
  Roland


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


Re: [jira] Resolved: (HTTPCORE-106) factor out HTTP parsing

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2007-08-06 at 17:31 +0200, Roland Weber wrote:
> Hi Oleg,
> 
> I've left the computer switched off for the weekend :-)
> 
> If you don't mind, I would like to investigate a slightly
> different take at the HttpMessageParser later this month
> or early in September:
> - stateless, re-usable implementation
> - separate parseRequest and parseResponse methods
> - fewer static methods for simplified overriding
> 
> Having a single class for parsing requests and responses
> should make it simpler for applications that need to change
> how headers are parsed.
> 
> Would such changes in core interfere with NIO?
> 

I am afraid so, as NIO parsers have got to be stateful. They need to
maintain state as message heads may be transmitted in multiple
incomplete chunks. So, we either have to have a completely different
message parsing frameworks for HttpCore main and HttpCore NIO or keep
request / response parsers stateful and separate.

Oleg   

> cheers,
>   Roland
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


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


Re: [jira] Resolved: (HTTPCORE-106) factor out HTTP parsing

Posted by Roland Weber <os...@dubioso.net>.
Hi Oleg,

I've left the computer switched off for the weekend :-)

If you don't mind, I would like to investigate a slightly
different take at the HttpMessageParser later this month
or early in September:
- stateless, re-usable implementation
- separate parseRequest and parseResponse methods
- fewer static methods for simplified overriding

Having a single class for parsing requests and responses
should make it simpler for applications that need to change
how headers are parsed.

Would such changes in core interfere with NIO?

cheers,
  Roland

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


[jira] Resolved: (HTTPCORE-106) factor out HTTP parsing

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

Oleg Kalnichevski resolved HTTPCORE-106.
----------------------------------------

    Resolution: Fixed

* Made similar changes in HttpCore main
* Moved garbage tolerant HTTP response parser to HttpClient

Oleg

> factor out HTTP parsing
> -----------------------
>
>                 Key: HTTPCORE-106
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-106
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha5
>            Reporter: Roland Weber
>            Assignee: Oleg Kalnichevski
>             Fix For: 4.0-alpha6
>
>
> HTTP parsing in HttpCore/main is currently implemented directly in the connection classes. To simplify replacing the parser, this code should be factored out into separate class (request/response), accessible via HttpParser interfaces. HttpNIO already has such interfaces.

-- 
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