[vlc-commits] httpd: match protocol before request verb
Rémi Denis-Courmont
git at videolan.org
Mon Jun 8 16:04:04 CEST 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 6 19:50:57 2020 +0300| [58e9b8a529ebc1dff3cfaa753848237306c465af] | committer: Rémi Denis-Courmont
httpd: match protocol before request verb
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=58e9b8a529ebc1dff3cfaa753848237306c465af
---
src/network/httpd.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/network/httpd.c b/src/network/httpd.c
index c2cd6afee3..1935487c50 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -1423,15 +1423,11 @@ static void httpd_ClientRecv(httpd_client_t *cl)
cl->query.i_type = HTTPD_MSG_NONE;
for (unsigned i = 0; i < ARRAY_SIZE(msg_type); i++)
- if (!strncmp((char *)cl->p_buffer, msg_type[i].name,
- strlen(msg_type[i].name))) {
+ if (cl->query.i_proto == msg_type[i].i_proto
+ && strncmp((char *)cl->p_buffer, msg_type[i].name,
+ strlen(msg_type[i].name)) == 0) {
p = (char *)&cl->p_buffer[strlen(msg_type[i].name) + 1 ];
cl->query.i_type = msg_type[i].i_type;
- if (cl->query.i_proto != msg_type[i].i_proto) {
- p = NULL;
- cl->query.i_proto = HTTPD_PROTO_NONE;
- cl->query.i_type = HTTPD_MSG_NONE;
- }
break;
}
More information about the vlc-commits
mailing list