src/server/daemon/protocol.c

changeset 385
a1f4cb076d2f
parent 251
f727a21497bb
child 415
d938228c382e
equal deleted inserted replaced
210:21274e5950af 385:a1f4cb076d2f
345 7, 345 7,
346 rq->srvhdrs); 346 rq->srvhdrs);
347 } 347 }
348 348
349 // set stream property 349 // set stream property
350 HttpStream *stream = (HttpStream*)sn->csd; 350 HttpStream *stream = (HttpStream*)sn->csd; // TODO: make this typesafe
351 stream->chunked_enc = 1; 351 stream->chunked_enc = 1;
352 rq->rq_attr.chunked = 1; 352 rq->rq_attr.chunked = 1;
353 } 353 }
354 354
355 // add header from rq->srvhdrs 355 // add header from rq->srvhdrs
372 conn->write(conn, out->ptr, out->length); 372 conn->write(conn, out->ptr, out->length);
373 sbuf_free(out); 373 sbuf_free(out);
374 374
375 rq->senthdrs = 1; 375 rq->senthdrs = 1;
376 376
377 return 0;
378 }
379
380 int http_send_continue(Session *sn) {
381 NSAPISession *s = (NSAPISession*)sn;
382 sstr_t msg = S("HTTP/1.1 100 Continue\r\n\r\n");
383 int w = s->connection->write(s->connection, msg.ptr, msg.length);
384 if(w != msg.length) {
385 return 1;
386 }
377 return 0; 387 return 0;
378 } 388 }
379 389
380 int request_header(char *name, char **value, Session *sn, Request *rq) { 390 int request_header(char *name, char **value, Session *sn, Request *rq) {
381 const pb_key *key = pblock_key(name); 391 const pb_key *key = pblock_key(name);

mercurial