#!/usr/local/bin/perl
#server_content.pl
use Sys::Hostname qw/hostname/;
use HTTP::Headers;
my $respstr;
if (rand(100) < 20) {
print "Conflict 409\n\r\n\r\n";
exit(1);
}
if ($ARGV[0] eq 'HEAD') {
$respstr = '
http://co1.search.live.net:88';
$respstr .= $ARGV[1];
$respstr .= <
0
0
128629751982538969
18446744073709551615
128632226810164042
3
sandbox
ERWDX
GETEOF2
#
#
#Authentication failed
#0x00000000
#The operation succeeded
#co1sch7080801
#
} elsif ($ARGV[0] eq 'GET') {
$respstr = '
http://portal.cosmos02-prod-co1.search.live.net:88';
$respstr .= $ARGV[1];
$respstr .= <
0
0
128629751982538969
18446744073709551615
128632226810164042
3
sandbox
ERWDX
GETEOF2
} elsif ($ARGV[0] eq 'POST') {
$respstr = '
http://co1.search.live.net:88';
$respstr .= $ARGV[1];
$respstr .= <
$ARGV[2]
POSTEOF2
system("cat /var/tmp/cosmos_server.content>>/var/tmp/cluster/orgs_".hostname);
} elsif ($ARGV[0] eq 'PUT') {
$respstr = '
http://prod-co1.search.live.net:88';
$respstr .= $ARGV[1];
$respstr .= <
$ARGV[2]
PUTEOF2
system("cat /var/tmp/server.content>>/var/tmp/cluster/orgs_".hostname);
} else {
exit(1);
}
print "OK 200\nCache-Control: private\nContent-Length: ", length($respstr) ,"\nContent-Type: application/xml; charset=utf-8\nSet-Cookie: Session=F306972E-F9B0-4D13-958D-0A561AFD6985; Path=/\nProxy-Connection: Keep-Alive\r\n\r\n",$respstr;