Skip Menu |

This queue is for tickets about the XML-Compile-SOAP CPAN distribution.

Report information
The Basics
Id: 88019
Status: resolved
Priority: 0/
Queue: XML-Compile-SOAP

People
Owner: Nobody in particular
Requestors: bret.lambert [...] gmail.com
Cc:
AdminCc:

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



Subject: Incorrect use of HTTP::Request in compiled clients
Date: Thu, 22 Aug 2013 09:09:07 +0200
To: bug-XML-Compile-SOAP [...] rt.cpan.org
From: Bret Lambert <bret.lambert [...] gmail.com>
I noticed that, for processes which were long-running and connected to the same server multiple times, each request would append the server's cookie one more time, meaning that on request #N, I would have N copies of the same cookie in the request. Obviously, this is not so awesome. With the help of a friend who is more perl-capable than I, we tracked the issue down to the reuse of HTTP:Request objects in the closures returned when compiling clients. In reality, they should be new objects for each request. Moving the request object creation into the closures resolves the issue for me. Diff below. --- SOAPHTTP.pm.orig Thu Aug 22 08:48:21 2013 +++ SOAPHTTP.pm Thu Aug 22 08:58:33 2013 @@ -119,14 +119,6 @@ , method => $method; } - # Prepare request - - # Ideally, we should change server when one fails, and stick to that - # one as long as possible. - my $server = $self->address; - my $request = HTTP::Request->new($method => $server, $header); - $request->protocol('HTTP/1.1'); - # Create handler my ($create_message, $parse_message) @@ -142,6 +134,13 @@ $hook ? sub # hooked code { my $trace = $_[1]; + + # Prepare request + + my $server = $self->address; + my $request = HTTP::Request->new($method => $server, $header); + $request->protocol('HTTP/1.1'); + $create_message->($request, $_[0], $_[2]); $trace->{http_request} = $request; @@ -172,6 +171,13 @@ : sub # real call { my $trace = $_[1]; + + # Prepare request + + my $server = $self->address; + my $request = HTTP::Request->new($method => $server, $header); + $request->protocol('HTTP/1.1'); + $create_message->($request, $_[0], $_[2]); $trace->{http_request} = $request;
Subject: Re: [rt.cpan.org #88019] Incorrect use of HTTP::Request in compiled clients
Date: Thu, 22 Aug 2013 11:52:33 +0200
To: Bret Lambert via RT <bug-XML-Compile-SOAP [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Bret Lambert via RT (bug-XML-Compile-SOAP@rt.cpan.org) [130822 07:09]: Show quoted text
> Thu Aug 22 03:09:33 2013: Request 88019 was acted upon. > Transaction: Ticket created by bret.lambert@gmail.com > Queue: XML-Compile-SOAP > Subject: Incorrect use of HTTP::Request in compiled clients > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88019 > > > I noticed that, for processes which were long-running and connected to the > same server multiple times, each request would append the server's cookie > one more time,
Ouch... too much optimization :( Show quoted text
> - # one as long as possible. > - my $server = $self->address;
We can leave "$server" on its spot. The other change is accepted for next release (this week) -- Thanks for your contribution, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Fixed in 2.38