3ad2d52001-02-01Per Hedbor inherit "http_common"; void main(int argc, array argv) {
136c032001-02-20Per Hedbor  string sep = "\r\n"; int psize = 100000; if( argc < 4 ) exit( BADARG ); if( argc == 5 ) { switch( (int)argv[4] ) { case 1: break; case 2: sep = "\n"; break; case 3: psize = 1; break; case 4: psize = 10; break; } }
3ad2d52001-02-01Per Hedbor  Stdio.File f = connect( argv[1] );
7fc4a92001-06-24Martin Nilsson  write_fragmented( f,
136c032001-02-20Per Hedbor  "GET "+argv[2]+" HTTP/1.0"+sep+ "Connection: close"+sep+
bd02052001-09-25Martin Nilsson  "User-Agent: Roxen Testscript"+sep+sep,
136c032001-02-20Per Hedbor  psize );
3ad2d52001-02-01Per Hedbor  string _d = f->read(); array q = _d/"\r\n\r\n"; if( sizeof( q ) < 2 ) exit( BADHEADERS );
a3d6892001-02-01Per Hedbor  verify_headers( q[0], strlen(q[1]), "HTTP/1.0", (argv[2] != "/nofile" ? 200 : 404), (argv[2][strlen(argv[2])-3..]=="raw"));
3ad2d52001-02-01Per Hedbor  if( (int)argv[3] ) if( q[1] != ("\0" * (int)argv[3]) ) exit( BADDATA ); exit( OK ); }