http: added http_sock_tcp()
This commit is contained in:
parent
76b48730f2
commit
b9fcf9d0d6
2 changed files with 14 additions and 0 deletions
|
@ -135,6 +135,7 @@ int http_listen(struct http_sock **sockp, const struct sa *laddr,
|
|||
http_req_h *reqh, void *arg);
|
||||
int https_listen(struct http_sock **sockp, const struct sa *laddr,
|
||||
const char *cert, http_req_h *reqh, void *arg);
|
||||
struct tcp_sock *http_sock_tcp(struct http_sock *sock);
|
||||
const struct sa *http_conn_peer(const struct http_conn *conn);
|
||||
struct tcp_conn *http_conn_tcp(struct http_conn *conn);
|
||||
struct tls_conn *http_conn_tls(struct http_conn *conn);
|
||||
|
|
|
@ -319,6 +319,19 @@ int https_listen(struct http_sock **sockp, const struct sa *laddr,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the TCP socket of an HTTP socket
|
||||
*
|
||||
* @param sock HTTP socket
|
||||
*
|
||||
* @return TCP socket
|
||||
*/
|
||||
struct tcp_sock *http_sock_tcp(struct http_sock *sock)
|
||||
{
|
||||
return sock ? sock->ts : NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the peer address of an HTTP connection
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue