src/server/daemon/httprequest.c

changeset 136
9b48a1427aef
parent 133
87b405d61f64
child 138
06619bbd14ef
--- a/src/server/daemon/httprequest.c	Tue Dec 27 18:42:36 2016 +0100
+++ b/src/server/daemon/httprequest.c	Tue Dec 27 19:36:19 2016 +0100
@@ -184,7 +184,14 @@
     } else if(!sstrcmp(request->httpv, S("HTTP/1.0"))) {
         rq->rq.protv_num = PROTOCOL_VERSION_HTTP10;
     } else {
-        // TODO: invalid protocol version - abort
+        // invalid protocol version - abort
+        log_ereport(
+                LOG_FAILURE,
+                "invalid protocol version: %.*s",
+                (int)request->httpv.length,
+                request->httpv.ptr);
+        pool_destroy(pool);
+        return 1;
     }
 
     /*
@@ -240,7 +247,7 @@
                 rq->rq.reqpb);
     } else {
         // TODO: log error
-        printf("unescape failed\n");
+        log_ereport(LOG_WARN, "uri unescape failed");
         pblock_kvinsert(pb_key_uri, "/", 1, rq->rq.reqpb);
     }
 
@@ -605,8 +612,12 @@
     if(ret == REQ_NOACTION && ppath == NULL) {
         sstr_t docroot = rq->vs->document_root;
         if(docroot.length < 1) {
-            printf("docroot too short\n");
-            return REQ_ABORTED; /* docroot too short */
+            log_ereport(
+                    LOG_WARN,
+                    "VirtualServer(%.*s) docroot too short",
+                    (int)rq->vs->name.length,
+                    rq->vs->name.ptr);
+            return REQ_ABORTED; // docroot too short
         }
         
         // if there is a trailing '/', remove it

mercurial