Problem at removing/set header of HttpMessage

"Trustin Lee (이희승)" trustin at gmail.com
Mon May 3 21:35:51 EDT 2010


Hi K,

Thanks for reporting the bug.  You can post the bug here or file a JIRA
issue at: http://jira.jboss.org/

Before applying the suggested fix, I'd like to make sure I can reproduce
the bug.  Could you please post some simple test code that reproduces
the problem?  For example:

        HttpMessage m = new DefaultHttpRequest(...);
        m.setHeader("SESSION", "A");
        m.removeHeader("SESSION");
        System.out.println(m.getHeader("SESSION"));
        System.out.println(m.getHeaders());

The expected output is 'null' and '[]' in this case.  You could
add/set/remove some headers to show the case where a certain header is
not removed.

Thanks a lot,
Trustin

krislo wrote:
> Hi,
> 
> 
> I detected some strange behavior on manipulating Http req/resp header (eq.
> removing or setting the new value to 'SESSION' header of RTSP message).
> Header line is not removed or is duplicated with the new set value.
> 
> I have checked a little and focused on HttpHeader class and when
> removeHeader0(...) is called, Entry is just not detached from before/after
> in the linked list. I have changed the first for-loop to remove the links
> with e.remove() :
> 
> ...
> for (;;) {
>             if (e.hash == h && eq(name, e.key)) {
>                 Entry next = e.next;
>                 e.remove();
>                 if (next != null) {
>                     entries[i] = next;
>                     e = next;
>                 } else {
>                     entries[i] = null;
>                     return;
>                 }
>             } else {
>                 break;
>             }
>         }
> 
> 
> By doing this it seems function behaves better but I haven't check deeper,
> so just FYI that issue is present.
> 
> 
> 
> For further issue reporting (if I detect some other...) where it can be
> reported? 
> Is it ok to post to this forum?
> 
> tnx & brg,
> K
> 
> 

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100504/6247c1c0/attachment-0001.bin 


More information about the netty-users mailing list