mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
clean-out-poll-array-when-hanging-up-on-client.patch
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
764ff98b2a
commit
de6ab32861
1 changed files with 13 additions and 0 deletions
|
@ -144,10 +144,23 @@ void
|
|||
libwebsockets_hangup_on_client(struct libwebsocket_context *this, int fd)
|
||||
{
|
||||
struct libwebsocket *wsi = wsi_from_fd(this, fd);
|
||||
int n;
|
||||
|
||||
if (wsi == NULL)
|
||||
return;
|
||||
|
||||
delete_from_fd(this, fd);
|
||||
|
||||
for (n = 0; n < this->fds_count - 1; n++)
|
||||
if (this->fds[n].fd == fd) {
|
||||
while (n < this->fds_count - 1) {
|
||||
this->fds[n] = this->fds[n + 1];
|
||||
n++;
|
||||
}
|
||||
n = this->fds_count;
|
||||
this->fds_count--;
|
||||
}
|
||||
|
||||
libwebsocket_close_and_free_session(wsi);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue