Branch: Tag:

2001-02-01

2001-02-01 08:36:45 by Per Hedbor <ph@opera.com>

More HTTP tests.

Rev: server/etc/test/tests/http/RoxenTest_http.pike:1.2
Rev: server/etc/test/tests/http/http09.pike:1.2
Rev: server/etc/test/tests/http/http10.pike:1.2
Rev: server/etc/test/tests/http/http_common.pike:1.2
Rev: server/etc/test/tests/http/ping.pike:1.1
Rev: server/etc/test/tests/pike_async_process_test_common.pike:1.2

2:      void main(int argc, array argv)   { -  if( argc != 4 ) exit( BADARG ); +  string sep; +  if( argc < 4 ) exit( BADARG ); +  if( argc == 5 ) sep = "\n"; else sep = "\r\n";       Stdio.File f = connect( argv[1] );    -  f->write( "GET "+argv[2]+" HTTP/1.0\r\n" -  "User-Agent: testcript\r\n" -  "\r\n" ); +  f->write( "GET "+argv[2]+" HTTP/1.0"+sep+ +  "User-Agent: testcript"+sep+ +  sep );       string _d = f->read();   
16:    if( sizeof( q ) < 2 )    exit( BADHEADERS );    -  verify_headers( q[0], strlen(q[1]) ); +  verify_headers( q[0], strlen(q[1]), "HTTP/1.0", +  (argv[2] != "/nofile" ? 200 : 404), +  (argv[2][strlen(argv[2])-3..]=="raw"));       if( (int)argv[3] )    if( q[1] != ("\0" * (int)argv[3]) )