uh_get_con_sock(): New function
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>main
parent
cb5cfff75b
commit
519559c12f
|
@ -109,6 +109,8 @@ struct uh_str *uh_get_query(struct uh_connection *con);
|
||||||
struct uh_str uh_get_var(struct uh_connection *con, const char *name);
|
struct uh_str uh_get_var(struct uh_connection *con, const char *name);
|
||||||
struct uh_str *uh_get_header(struct uh_connection *con, const char *name);
|
struct uh_str *uh_get_header(struct uh_connection *con, const char *name);
|
||||||
|
|
||||||
|
int uh_get_con_sock(struct uh_connection *con);
|
||||||
|
|
||||||
/* Unescapes strings like '%7B1,%202,%203%7D' would become '{1, 2, 3}' */
|
/* Unescapes strings like '%7B1,%202,%203%7D' would become '{1, 2, 3}' */
|
||||||
int uh_unescape(const char *str, int len, char *out, int olen);
|
int uh_unescape(const char *str, int len, char *out, int olen);
|
||||||
|
|
||||||
|
|
|
@ -582,6 +582,11 @@ inline struct uh_str *uh_get_query(struct uh_connection *con)
|
||||||
return &con->req.query;
|
return &con->req.query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int uh_get_con_sock(struct uh_connection *con)
|
||||||
|
{
|
||||||
|
return con->sock;
|
||||||
|
}
|
||||||
|
|
||||||
static inline char c2hex(char c)
|
static inline char c2hex(char c)
|
||||||
{
|
{
|
||||||
return c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c - 'a' + 10; /* accept small letters just in case */
|
return c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c - 'a' + 10; /* accept small letters just in case */
|
||||||
|
|
Loading…
Reference in New Issue