1 | | |
2 | | |
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
18 | | |
19 | | |
20 | | |
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
35 | | |
36 | | |
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | |
| inherit "http_common"; | | void main(int argc, array argv) | { | 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; | } | } | | Stdio.File f = connect( argv[1] ); | | | write_fragmented( f, | "GET "+argv[2]+" HTTP/1.0"+sep+ | "Connection: close"+sep+ | "User-Agent: testcript"+sep+sep, | psize ); | | string _d = f->read(); | | array q = _d/"\r\n\r\n"; | if( sizeof( q ) < 2 ) | exit( BADHEADERS ); | | 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]) ) | exit( BADDATA ); | | exit( OK ); | } | | |
|