mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 13:49:01 +08:00
Fix parse uri
PUBLISHED_FROM=9bc251ed259e909a8438f95a82d0a229b5a834cf
This commit is contained in:
parent
8c394f44b8
commit
67521fd9f6
@ -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;
|
||||
while (p < end) {
|
||||
printf("STATE: %d (%s)\n", state, p);
|
||||
switch (state) {
|
||||
case P_START:
|
||||
/*
|
||||
@ -3859,12 +3858,14 @@ int mg_parse_uri(struct mg_str uri, struct mg_str *scheme,
|
||||
state = P_HOST;
|
||||
break;
|
||||
} else if (*p == '/') {
|
||||
/* backtrack and parse as host */
|
||||
state = P_HOST;
|
||||
p = ruser_info.p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p == end || *p == '/') {
|
||||
/* backtrack and parse as host */
|
||||
state = P_HOST;
|
||||
p = ruser_info.p;
|
||||
}
|
||||
ruser_info.len = p - ruser_info.p;
|
||||
break;
|
||||
case P_HOST:
|
||||
|
Loading…
Reference in New Issue
Block a user