src/server/daemon/protocol.c

changeset 108
2a394ccdd778
parent 104
a8acbb12f27c
child 110
43a746e905f6
equal deleted inserted replaced
107:7e81699d1f77 108:2a394ccdd778
287 } 287 }
288 } 288 }
289 } 289 }
290 290
291 int http_start_response(Session *sn, Request *rq) { 291 int http_start_response(Session *sn, Request *rq) {
292 int fd = ((NetIOStream*)sn->csd)->fd; 292 Connection *conn = ((NSAPISession*)sn)->connection;
293 293
294 if(rq->status_num == -1) { 294 if(rq->status_num == -1) {
295 protocol_status(sn, rq, 200, "OK"); 295 protocol_status(sn, rq, 200, "OK");
296 } 296 }
297 297
362 362
363 // response header end 363 // response header end
364 sbuf_write(out, "\r\n", 2); 364 sbuf_write(out, "\r\n", 2);
365 365
366 // flush buffer to the socket 366 // flush buffer to the socket
367 write(fd, out->ptr, out->length); 367 conn->write(conn, out->ptr, out->length);
368 sbuf_free(out); 368 sbuf_free(out);
369 369
370 rq->senthdrs = 1; 370 rq->senthdrs = 1;
371 371
372 return 0; 372 return 0;

mercurial