--- a/src/server/daemon/protocol.c Sat Oct 31 16:39:12 2015 +0100 +++ b/src/server/daemon/protocol.c Sat Oct 31 18:02:07 2015 +0100 @@ -289,7 +289,7 @@ } int http_start_response(Session *sn, Request *rq) { - int fd = ((NetIOStream*)sn->csd)->fd; + Connection *conn = ((NSAPISession*)sn)->connection; if(rq->status_num == -1) { protocol_status(sn, rq, 200, "OK"); @@ -364,7 +364,7 @@ sbuf_write(out, "\r\n", 2); // flush buffer to the socket - write(fd, out->ptr, out->length); + conn->write(conn, out->ptr, out->length); sbuf_free(out); rq->senthdrs = 1;