src/server/daemon/httpparser.c

changeset 385
a1f4cb076d2f
parent 351
5533db9b64e2
child 415
d938228c382e
--- a/src/server/daemon/httpparser.c	Tue Aug 13 22:14:32 2019 +0200
+++ b/src/server/daemon/httpparser.c	Sat Sep 24 16:26:10 2022 +0200
@@ -187,7 +187,6 @@
     for(;i<line.length;i++) {
         if(!ns && line.ptr[i] == ' ') {
             ns = 1;
-            //line.ptr[i] = 0; // TODO: remove
             parser->request->method.length = i;
         } else if(ns) {
             if(line.ptr[i] != ' ') {
@@ -200,9 +199,8 @@
     ns = 0;
     int s = i;
     for(;i<line.length;i++) {
-        if(!ns && line.ptr[i] < 33) {
+        if(!ns && isspace(line.ptr[i])) {
             ns = 1;
-            //line.ptr[i] = 0; // TODO: remove
             parser->request->uri.length = i - s;
         } else if(ns) {
             if(line.ptr[i] > 32) {
@@ -215,9 +213,8 @@
     ns = 0;
     s = i;
     for(;i<line.length;i++) {
-        if(!ns && line.ptr[i] < 33) {
+        if(!ns && isspace(line.ptr[i])) {
             ns = 1;
-            //line.ptr[i] = 0; // TODO: remove
             parser->request->httpv.length = i - s;
         } else if(ns) {
             if(line.ptr[i] > 32) {

mercurial