LWP::UserAgent POSTing creates 2 packets - I want just 1
LWP::UserAgent POSTing creates 2 packets - I want just 1
am 27.10.2005 23:42:33 von jmulvey123
Hello,
I am using LWP::UserAgent to create a POST request to a URL. The POST
request includes some data in the body of the HTTP request. I have used
a network sniffer and found that, unfortunately, the POST request
always gets split up into two separate packets. This is causing some
difficulty which I won't go into here, although I understand it's valid
from an HTTP perspective.
Is there any way I can force LWP::UserAgent to consolidate the POST
request into a single packet? Or are there other modules I should use
instead?
My code is below:
#!/usr/bin/perl
require LWP::UserAgent;
require HTML::LinkExtor;
require Crypt::SSLeay;
use Fcntl;
$ua = LWP::UserAgent->new;
$ua->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5)
Gecko/20031007 Firebird/0.7');
$request = HTTP::Request->new('POST',
"http://server.company.org/path/target.aspx");
$request->header('Pragma'=>'no-cache');
$request->header('Accept'=>'*/*');
$request->header('Accept-Encoding'=>'gzip');
$request->header('User-Agent'=>'Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.0)');
#$request->header('Content-type'=>'application/x-www-form-ur lencoded');
$request->content_type('application/x-www-form-urlencoded');
$request->header('Proxy-Connection: Keep-Alive');
$request->content('userid=joesixpack&password=ilikebudweiser ');
$response = $ua->request($request);
print $response->header;
print $response->as_string;
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 28.10.2005 00:09:19 von John Bokma
jmulvey123@gmail.com wrote:
> a network sniffer and found that, unfortunately, the POST request
> always gets split up into two separate packets. This is causing some
> difficulty which I won't go into here
spoofing?
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 28.10.2005 00:46:03 von Robert Jordan
> I am using LWP::UserAgent to create a POST request to a URL. The POST
> request includes some data in the body of the HTTP request. I have used
> a network sniffer and found that, unfortunately, the POST request
> always gets split up into two separate packets. This is causing some
> difficulty which I won't go into here, although I understand it's valid
> from an HTTP perspective.
>
> Is there any way I can force LWP::UserAgent to consolidate the POST
> request into a single packet? Or are there other modules I should use
> instead?
That's the way TCP works. It may split the stream in as much
packets it likes.
Rob
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 28.10.2005 22:49:11 von jmulvey123
No, I'm not spoofing. I'm not sure how consolidating the HTTP header
and body would help spoofing. Maybe you can elaborate.
I'm actually trying to accomplish single sign-on between one piece of
network infrastructure (Aventail) with another (Oracle COREid).
Aventail is an SSL/VPN solution. Users, using a browser, access the
Aventail system from the Internet and authenticate to Aventail using
their Active Directory credentials. We are trying to get Aventail to,
in turn, use these credentials to log the user into COREid, and
Aventail then will pass the cookie back to the user. Aventail has this
capability to use an HTTP POST of the user's credentials to a URL
that is specified in the Aventail configuration. After the HTTP POST
operation, the Aventail appliance can be configured to look for a
cookie (ObSSOCookie) and pass that cookie back to the user.
The only catch is that the Oracle COREid solution only works properly
when the HTTP POST packet includes the header and body in a single
packet.
So does that help somehow in explaining how to get Perl to consolidate
a post request into a single packet? Any thoughts on the problem?
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 28.10.2005 22:51:29 von jmulvey123
Yes, but in this case the data is much smaller than the packet frame
size. So not only is it inefficient, but it is causing me difficulty.
If it *may* split the stream (but it doesn't *have to*), then how can I
coerce it into making the right decision?
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 28.10.2005 23:27:15 von Robert Jordan
> Yes, but in this case the data is much smaller than the packet frame
> size. So not only is it inefficient, but it is causing me difficulty.
>
> If it *may* split the stream (but it doesn't *have to*), then how can I
> coerce it into making the right decision?
>
Please stop taking guesses about TCP packets. What you call
"inefficient" it's the "Slow Start" congestion avoidance of
the TCP protocol.
The problem is somewhere in your script.
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 29.10.2005 00:09:19 von xhoster
jmulvey123@gmail.com wrote:
> Yes, but in this case the data is much smaller than the packet frame
> size. So not only is it inefficient, but it is causing me difficulty.
>
> If it *may* split the stream (but it doesn't *have to*), then how can I
> coerce it into making the right decision?
A while ago when someone wanted to micromanage their packets, they
reported that Net::Packet did the trick.
http://groups.google.com/group/comp.lang.perl.misc/browse_fr m/thread/989e66
2af11fda8b
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 29.10.2005 06:27:36 von John Bokma
jmulvey123@gmail.com wrote:
> No, I'm not spoofing. I'm not sure how consolidating the HTTP header
> and body would help spoofing. Maybe you can elaborate.
that's what keeping everything in 1 packet sounds to me.
....
> The only catch is that the Oracle COREid solution only works properly
> when the HTTP POST packet includes the header and body in a single
> packet.
You mean a TCP/IP packet? That sounds extremely odd to me.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 01.11.2005 20:55:50 von jmulvey123
Agreed. It is strange. Oracle COREid has this problem because they are
POSTing the data to an IIS ISAPI filter. Microsoft recommends against
passing POST data to an ISAPI filer (better to do it as an extension).
Unfortunately, I didn't write the product. I'm just trying to integrate
with it.
Anyway, obviously you're not going to be any help to me unless I'm
trying to get myself reported to the Department of Homeland Security. I
welcome you to do that, but I certainly won't go to this newsgroup for
any help unless I'm looking for a big heaping portion of superiority
complex and accusatory non-technical judgements.
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 01.11.2005 23:50:48 von John Bokma
jmulvey123@gmail.com wrote:
> welcome you to do that, but I certainly won't go to this newsgroup for
> any help unless I'm looking for a big heaping portion of superiority
> complex and accusatory non-technical judgements.
If you keep insisting on not quoting you might not even get a single reply
in the future. Pissing of people in a technical group is always a good
thing if you need help.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 02.11.2005 16:20:22 von jmulvey123
Thanks, John. Its good to know Perl programmers like you are on this
usenet group to help out others.
Re: LWP::UserAgent POSTing creates 2 packets - I want just 1
am 02.11.2005 23:13:11 von John Bokma
jmulvey123@gmail.com wrote:
> Thanks, John. Its good to know Perl programmers like you are on this
> usenet group to help out others.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)