| 116 } |
116 } |
| 117 |
117 |
| 118 test_finished = 0; |
118 test_finished = 0; |
| 119 int ret = http_client_start(client); |
119 int ret = http_client_start(client); |
| 120 CX_TEST_ASSERT(ret == 0); |
120 CX_TEST_ASSERT(ret == 0); |
| |
121 |
| |
122 while(client->stage == 0) { |
| |
123 char buf[4096]; |
| |
124 if(read(fds[1], buf, 4096) <= 0) { |
| |
125 break; |
| |
126 } |
| |
127 } |
| 121 |
128 |
| 122 for(int i=0;i<num_blocks;i++) { |
129 for(int i=0;i<num_blocks;i++) { |
| 123 size_t response_pos = 0; |
130 size_t response_pos = 0; |
| 124 cxstring response = response_blocks[i]; |
131 cxstring response = response_blocks[i]; |
| 125 while(response_pos < response.length) { |
132 while(response_pos < response.length) { |
| 278 "HTTP/1.1 200 OK\r\n" |
285 "HTTP/1.1 200 OK\r\n" |
| 279 "Content-length: 21\r\n" |
286 "Content-length: 21\r\n" |
| 280 "\r\n" |
287 "\r\n" |
| 281 "Hello World!---post3\n"); |
288 "Hello World!---post3\n"); |
| 282 |
289 |
| 283 size_t ctlen = 1024*64; |
290 size_t ctlen = 1024*1024*64; |
| 284 char *req_body = malloc(ctlen); |
291 char *req_body = malloc(ctlen); |
| 285 cxstring request_body = cx_strn(req_body, ctlen); |
292 cxstring request_body = cx_strn(req_body, ctlen); |
| 286 |
293 |
| 287 CxBuffer *out = cxBufferCreate(NULL, NULL, 256, CX_BUFFER_AUTO_EXTEND|CX_BUFFER_FREE_CONTENTS); |
294 CxBuffer *out = cxBufferCreate(NULL, NULL, 256, CX_BUFFER_AUTO_EXTEND|CX_BUFFER_FREE_CONTENTS); |
| 288 |
295 |