I am trying to pick up a POST request which appears to be stopping at the header which contains two '\r\n'. I'm not certain it's that or if I need to handle a Continuation differently. I have Etheral open on the request which displays the header in a POST / HTTP/1.0 and the body is on the next lined labeled Continuation.
Should the server close the $addr connection upon reading the two \r\n or should something else be set within the server? All of the data is coming to my server. It just stops at the initial Header.
I've tried closing the connection, thinking a new connection would be made upon continuation but that does not work.
I have also tried to replicate the client side by building a perl client test with the \r\n\r\n in and it works fine. The client making the request is coming from a MS tool. Is there a character conflict that anyone knows of? I also tried catching \015\012\015\012 but I am not sure what should be done at the Continuation point.
use IO::Socket;
$local = IO::Socket::INET->new(
Proto => 'tcp',
LocalAddr => '192.168.150.131:80', Reuse => 1
) or die "$!";
$local->listen();
print "Awaiting client...\n";
my $addr;
while ($addr = $local->accept() ) {
$addr->autoflush(1);
print "Connecting from: ", $addr->peerhost();
print " Port: ", $addr->peerport(), "\n";
while (<$addr>) {
# Should a catch go here upon the \r\n\r\n and close conn
# or a call to accept continuation?
# Everything is coming into the computer
# The server just stops
print "Client: $_";
}
close $addr; # close client
print "Idle...\n";
}
Any suggestions would be greatly appreciated. I have hit complete discombobulation mode.
Thanks for the help,
DWW
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.