optimize code

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
This commit is contained in:
Jianhui Zhao committed 2017-12-09 17:03:29 +08:00
1 parent 1873edb5ed
commit f096369b5b
2 files changed
+8 -10

No files matched your search

+8
View File
@@ -23,4 +23,12 @@ struct uh_str {
size_t len;
};
/* Return 1 for equal */
static inline int uh_str_cmp(struct uh_str *uv, const char *str)
{
if (uv->len != strlen(str))
return 0;
return (!strncasecmp(uv->at, str, uv->len));
}
#endif
-10
View File
@@ -182,16 +182,6 @@ static int on_body(http_parser *parser, const char *at, size_t len)
return 0;
}
/* Return 1 for equal */
static int uh_str_cmp(struct uh_str *uv, const char *str)
{
if (uv->len != strlen(str))
return 0;
return (!strncasecmp(uv->at, str, uv->len));
}
static int on_message_complete(http_parser *parser)
{
struct uh_connection *con = container_of(parser, struct uh_connection, parser);