fixed ssl

Sat, 31 Oct 2015 18:02:07 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 31 Oct 2015 18:02:07 +0100
changeset 108
2a394ccdd778
parent 107
7e81699d1f77
child 109
8a0a7754f123

fixed ssl

src/server/daemon/error.c file | annotate | diff | comparison | revisions
src/server/daemon/protocol.c file | annotate | diff | comparison | revisions
src/server/daemon/request.h file | annotate | diff | comparison | revisions
src/server/util/object.h file | annotate | diff | comparison | revisions
--- a/src/server/daemon/error.c	Sat Oct 31 16:39:12 2015 +0100
+++ b/src/server/daemon/error.c	Sat Oct 31 18:02:07 2015 +0100
@@ -104,8 +104,8 @@
         // error
     }
     
-    write(req->connection->fd, buf, len);
-    write(req->connection->fd, msg.ptr, msg.length);
+    req->connection->write(req->connection, buf, len);
+    req->connection->write(req->connection, msg.ptr, msg.length);
     
-    close(req->connection->fd);
+    req->connection->close(req->connection);
 }
--- 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;
--- a/src/server/daemon/request.h	Sat Oct 31 16:39:12 2015 +0100
+++ b/src/server/daemon/request.h	Sat Oct 31 18:02:07 2015 +0100
@@ -40,7 +40,7 @@
 
 struct NSAPIRequest {
     Request        rq;
-    RequestPhase   phase;
+    RequestStage   phase;
     VirtualServer  *vs;
     NSAPIContext   context;
     void           *jvm_context;
--- a/src/server/util/object.h	Sat Oct 31 16:39:12 2015 +0100
+++ b/src/server/util/object.h	Sat Oct 31 18:02:07 2015 +0100
@@ -37,7 +37,7 @@
 #endif
 
 // TODO: Enum auslagern in andere Datei?
-enum RequestPhase {
+enum RequestStage {
     NSAPIAuthTrans = 0,
     NSAPINameTrans,
     NSAPIPathCheck,
@@ -48,7 +48,7 @@
     REQ_FINISH,
     NUM_NSAPI_TYPES
 };
-typedef enum RequestPhase RequestPhase;
+typedef enum RequestStage RequestStage;
 
 typedef struct Condition          Condition;
 typedef int8_t                    ConditionResult;

mercurial