mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
introduce-libwebsockets_hangup_on_client.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
38c4f0c556
commit
f7ee549a58
3 changed files with 35 additions and 0 deletions
|
@ -133,6 +133,25 @@ libwebsocket_close_and_free_session(struct libwebsocket *wsi)
|
|||
free(wsi);
|
||||
}
|
||||
|
||||
/**
|
||||
* libwebsockets_hangup_on_client() - Server calls to terminate client
|
||||
* connection
|
||||
* @this: libwebsockets context
|
||||
* @fd: Connection socket descriptor
|
||||
*/
|
||||
|
||||
void
|
||||
libwebsockets_hangup_on_client(struct libwebsocket_context *this, int fd)
|
||||
{
|
||||
struct libwebsocket *wsi = wsi_from_fd(this, fd);
|
||||
|
||||
if (wsi == NULL)
|
||||
return;
|
||||
|
||||
libwebsocket_close_and_free_session(wsi);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* libwebsockets_get_peer_addresses() - Get client address information
|
||||
* @fd: Connection socket descriptor
|
||||
|
|
|
@ -388,4 +388,7 @@ extern void
|
|||
libwebsockets_get_peer_addresses(int fd, char *name, int name_len,
|
||||
char *rip, int rip_len);
|
||||
|
||||
extern void
|
||||
libwebsockets_hangup_on_client(struct libwebsocket_context *this, int fd);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
<h2>libwebsockets_hangup_on_client - Server calls to terminate client connection</h2>
|
||||
<i>void</i>
|
||||
<b>libwebsockets_hangup_on_client</b>
|
||||
(<i>struct libwebsocket_context *</i> <b>this</b>,
|
||||
<i>int</i> <b>fd</b>)
|
||||
<h3>Arguments</h3>
|
||||
<dl>
|
||||
<dt><b>this</b>
|
||||
<dd>libwebsockets context
|
||||
<dt><b>fd</b>
|
||||
<dd>Connection socket descriptor
|
||||
</dl>
|
||||
<hr>
|
||||
<h2>libwebsockets_get_peer_addresses - Get client address information</h2>
|
||||
<i>void</i>
|
||||
<b>libwebsockets_get_peer_addresses</b>
|
||||
|
|
Loading…
Add table
Reference in a new issue