Commit 67521fd9 authored by Marko Mikulicic's avatar Marko Mikulicic Committed by rojer

Fix parse uri

    PUBLISHED_FROM=9bc251ed259e909a8438f95a82d0a229b5a834cf
parent 8c394f44
...@@ -3816,7 +3816,6 @@ int mg_parse_uri(struct mg_str uri, struct mg_str *scheme, ...@@ -3816,7 +3816,6 @@ int mg_parse_uri(struct mg_str uri, struct mg_str *scheme,
const char *p = uri.p, *end = p + uri.len; const char *p = uri.p, *end = p + uri.len;
while (p < end) { while (p < end) {
printf("STATE: %d (%s)\n", state, p);
switch (state) { switch (state) {
case P_START: case P_START:
/* /*
...@@ -3859,11 +3858,13 @@ int mg_parse_uri(struct mg_str uri, struct mg_str *scheme, ...@@ -3859,11 +3858,13 @@ int mg_parse_uri(struct mg_str uri, struct mg_str *scheme,
state = P_HOST; state = P_HOST;
break; break;
} else if (*p == '/') { } else if (*p == '/') {
break;
}
}
if (p == end || *p == '/') {
/* backtrack and parse as host */ /* backtrack and parse as host */
state = P_HOST; state = P_HOST;
p = ruser_info.p; p = ruser_info.p;
break;
}
} }
ruser_info.len = p - ruser_info.p; ruser_info.len = p - ruser_info.p;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment