diff options
| author | Shu Li <[email protected]> | 2021-05-25 10:51:21 +0800 |
|---|---|---|
| committer | Shu Li <[email protected]> | 2021-05-25 10:51:21 +0800 |
| commit | 003fab7dbf1f51c7d39e047b2a26e94a64d38dac (patch) | |
| tree | d471e044c101d497bcd25c3587bab123b42e5931 /src | |
| parent | e1f1765d82ca852b704d19d4b575267eb1d3a057 (diff) | |
update
Diffstat (limited to 'src')
| -rw-r--r-- | src/HTTP_Parser.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/HTTP_Parser.c b/src/HTTP_Parser.c index 0e611ab..3b63e81 100644 --- a/src/HTTP_Parser.c +++ b/src/HTTP_Parser.c @@ -84,6 +84,7 @@ int http_host_parser(const char* buf, uint32 buflen, int http_dir, char** host) char* new_pbuf = NULL; uint32 new_pbuflen = 0; uchar method = HTTP_METHOD_UNKNOWN; + int method_idx = 1; //printf("buf=====================================================\n"); //printf("%s\n", buf); @@ -100,11 +101,11 @@ int http_host_parser(const char* buf, uint32 buflen, int http_dir, char** host) /*�����method�����ƶ�һ���ո���'/',Ҳ����"http://"�����Զ�����һ��'/'*/ if(buflen>HTTP_START_FLAGS_LEN+strlen("http://")) { - for(int i=1;i<=HTTP_METHOD_TRACE;i++) + for(method_idx=1;method_idx<=HTTP_METHOD_TRACE;method_idx++) { - if(0==strncasecmp(pbuf,g_http_method[i],strlen(g_http_method[i]))) + if(0==strncasecmp(pbuf,g_http_method[method_idx],strlen(g_http_method[method_idx]))) { - method = i; + method = method_idx; break; } } |
