66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
if (![[client readLine] isEqual: @"GET /foo HTTP/1.1"])
assert(0);
if (![[client readLine] isEqual:
[OFString stringWithFormat: @"Host: 127.0.0.1:%" @PRIu16, port]])
assert(0);
if (![[client readLine] isEqual: @"Connection: close"])
assert(0);
if (![[client readLine] hasPrefix: @"User-Agent:"])
assert(0);
if (![[client readLine] isEqual: @""])
assert(0);
[client writeString: @"HTTP/1.1 200 OK\r\n"
@"cONTeNT-lENgTH: 7\r\n"
@"\r\n"
@"foo\n"
@"bar"];
[client close];
return nil;
|
<
<
<
|
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
if (![[client readLine] isEqual: @"GET /foo HTTP/1.1"])
assert(0);
if (![[client readLine] isEqual:
[OFString stringWithFormat: @"Host: 127.0.0.1:%" @PRIu16, port]])
assert(0);
if (![[client readLine] hasPrefix: @"User-Agent:"])
assert(0);
if (![[client readLine] isEqual: @""])
assert(0);
[client writeString: @"HTTP/1.0 200 OK\r\n"
@"cONTeNT-lENgTH: 7\r\n"
@"\r\n"
@"foo\n"
@"bar"];
[client close];
return nil;
|