ASF Bugzilla – Attachment 17480 Details for
Bug 38346
InputBuffer breaks request.readLine()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test Client perl script
test_post.pl (text/plain), 1.53 KB, created by
Rainer Jung
on 2006-01-21 21:38:26 UTC
(
hide
)
Description:
Test Client perl script
Filename:
MIME Type:
Creator:
Rainer Jung
Created:
2006-01-21 21:38:26 UTC
Size:
1.53 KB
patch
obsolete
>#!/usr/bin/perl > >use strict; >use IO::Socket; > ># The port of the HTTP server >my $port = 21180; ># The name of the HTTP server >my $server = 'asf-t2k'; ># The HTTP Request >my $url='/test_post.jsp'; > ># The line length of the body - excluding the CR/LF >my $LINE=80; ># The number of lines in the body >my $COUNT=250; ># The size of the hunks we send data ># in the sense, that we pause between the chunks >my $CHUNK=8200; ># Pause time between sending chunks >my $SLEEP=1; > >my $cl='Content-Length: '; >my $ct='Content-Type: text/plain'; > >my $line = ( 'X' x $LINE ) . "\n"; >my $body = $line x $COUNT; >my $size=$COUNT*($LINE+1); >my $count=0; > >my $request=sprintf("POST %s HTTP/1.0", $url); >my $head=sprintf("%s\n%s%d\n%s\n\n",$request,$cl,$size,$ct); > ># Stop buffering STDOUT >select((select(OUT), $| = 1)[0]); > >my $sock = IO::Socket::INET->new(PeerHost => $server, > PeerPort => $port, > Proto => 'tcp') or > die "Cound not create socket: $!"; > >print "=====\nBody has $size bytes,\n"; >print "containing $COUNT lines of length $LINE\n"; >print "Sending '$request' to $server:$port\n"; >print "in chunks of $CHUNK bytes\n"; > ># Send the header >$sock->send($head); > ># Send the body one chunk at a time >while($size>0) { > $sock->send(substr($body,0,$CHUNK)); > $count++; > sleep $SLEEP; > if ( $size > $CHUNK ) { > $body=substr($body,$CHUNK,$size-$CHUNK); > $size-=$CHUNK; > } else { > $size=0; > } >} > >print "=====\n$count chunks written, waiting for response...\n=====\n"; > >while (defined ($body=<$sock>) ) { > print $body; >} >close($sock);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 38346
:
17478
|
17479
| 17480