Skip Menu |

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 46876
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: MARKOV [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 5.826
Fixed in: (no value)



Subject: Client-Transfer-Encoding: chunked
The XML::Compile::SOAP library uses LWP to exchange messages. Apparently, some servers return messages which are chunked. But not the usual "Transfer-Encoding: chunked", but a "Client-Transfer-Encoding: chunked". XML is usually produced with minimal layout, minimal blanks. This produces lines easily reaching the 998 limit. The tranditional MIME way to avoid problems is using 'base64' or 'quoted-printable' Content-Transfer-Encoding, but this is excluded from the HTTP spec. Apparently, someone designed an alternative. To decode this, the only thing which the decoding requires is to remove all \r?\n. I would welcome this support in HTTP::Message::decoded(). Or... do you think that none of the 'Client-' field interpretations should be handled in LWP?
On Fri Jun 12 03:56:35 2009, MARKOV wrote: Show quoted text
> The XML::Compile::SOAP library uses LWP to exchange messages. > Apparently, some servers return messages which are chunked. But not the > usual "Transfer-Encoding: chunked", but a "Client-Transfer-Encoding: > chunked". > > XML is usually produced with minimal layout, minimal blanks. This > produces lines easily reaching the 998 limit. The tranditional MIME way > to avoid problems is using 'base64' or 'quoted-printable' > Content-Transfer-Encoding, but this is excluded from the HTTP spec. > Apparently, someone designed an alternative. > > To decode this, the only thing which the decoding requires is to remove > all \r?\n. I would welcome this support in HTTP::Message::decoded(). > > Or... do you think that none of the 'Client-' field interpretations > should be handled in LWP?
The 'Client-*' fields are created by LWP during processing of responses (with a risk of confusion if the server actually send Client-* headers by itself). The 'Client-Transfer- Encoding' is really just a copy of the original Transfer-Encoding header which is removed because this encoding has already been undone (by the lower layers; Net::HTTP). The Content-Encoding is for the upper layers and what decoded_content() deals with. So you me it sounds that you have a server that introduce \r\n at inappropriate places in the message content without marking this is any Content-Encoding. Is that right?
Subject: Re: [rt.cpan.org #46876] Client-Transfer-Encoding: chunked
Date: Fri, 12 Jun 2009 21:56:09 +0200
To: Gisle_Aas via RT <bug-libwww-perl [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
Wow, what a fast response. Thanks! * Gisle_Aas via RT (bug-libwww-perl@rt.cpan.org) [090612 19:36]: Show quoted text
> The 'Client-*' fields are created by LWP during processing of responses
This explains a lot: why I can only find the tag with Perl programs on internet and no spec ;-b {I probably would have chosen a "LWP-" prefix} Show quoted text
> So you me it sounds that you have a server that introduce \r\n at > inappropriate places in the message content without marking this is any > Content-Encoding. Is that right?
Problem is that I try to figure-out a bug-report of someone else myself: it's not my application but a user of XML::Compile::SOAP. A part of the Data::Dumper output of HTTP::Response, which may give you a hint which I do not get B-] '_protocol' => 'HTTP/1.1', '_rc' => 500, '_msg' => 'Internal Server Error', '_content' => '<?xml version=\'1.0\' encoding=\'UTF-8\'?><S:Envelope xmlns: S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"><faul Show quoted text
tcode>S:Server</faultcode><faultstring>Rethrown: Rethrown com.wavecorp.mediabank.command.net.MediaBankCommunicationExcep
tion: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine</f ... etc Show quoted text
ackTrace></ns2:cause></ns2:exception></d
Show quoted text
etail></S:Fault></S:Body></S:Envelope>',
'_headers' => bless( { 'client-date' => 'Thu, 11 Jun 2009 20:22:29 GMT', 'connection' => 'close', 'content-type' => 'text/xml;charset=utf-8', 'client-response-num' => 1, 'date' => 'Thu, 11 Jun 2009 20:22:28 GMT', 'client-transfer-encoding' => [ 'chunked' ], 'client-peer' => '127.0.0.1:8080', 'server' => 'Apache-Coyote/1.1' }, 'HTTP::Headers' ), 'handlers' => { 'response_data' => [ { 'callback' => sub { "DUMMY" } } ] } I dod not find the location where you handle chunked, except HTTP::Daemon, which is server-side. I have a client application. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #46876] Client-Transfer-Encoding: chunked
Date: Sat, 13 Jun 2009 00:00:52 +0200
To: Gisle_Aas via RT <bug-libwww-perl [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Mark Overmeer (mark@overmeer.net) [090612 21:56]: Show quoted text
> Problem is that I try to figure-out a bug-report of someone else myself: > it's not my application but a user of XML::Compile::SOAP. A part of the > Data::Dumper output of HTTP::Response, which may give you a hint which > I do not get B-]
The party of my bug-report tells me that the problem I found with the truncated lines in his chunked message are probably due to his screen width :-( So, very probably I was hunting down ghosts. Sorry for spoiling your time. -- Thanks for your help! MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
On Fri Jun 12 15:56:31 2009, Mark@Overmeer.net wrote: Show quoted text
> I probably would have chosen a "LWP-" prefix
So would I :-( I think it started out as a innocent "Client-Date" header that added to record at what time the client received a response. After a while this came out of control and now I don't know any way to change this in a compatible manner, so I guess it's stuck at that. Show quoted text
> I dod not find the location where you handle chunked, except HTTP::Daemon, which > is server-side. I have a client application.
It's handled in the Net::HTTP module (more exactly Net::HTTP::Methods).