- single LF aware http_chunked_decode()
[m6w6/ext-http] / php_http_api.h
index 8906e2cda71793ae61fc92852e73c4fa3f4d8c49..25d305cf414ca23a3f3b3b619ad1ac261e8ed5c1 100644 (file)
@@ -75,6 +75,17 @@ static inline const char *_http_locate_body(const char *message)
        }
 }
 
+#define http_locate_eol _http_locate_eol
+static inline const char *_http_locate_eol(const char *line, size_t *eol_len)
+{
+       const char *eol = strpbrk(line, "\r\n");
+       
+       if (eol_len) {
+               *eol_len = eol ? ((eol[0] == '\r' && eol[1] == '\n') ? 2 : 1) : 0;
+       }
+       return eol;
+}
+
 #endif
 
 /*