mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
poll: Reformat ssh_event_free()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 8243030c55)
This commit is contained in:
@@ -1013,17 +1013,20 @@ int ssh_event_remove_connector(ssh_event event, ssh_connector connector){
|
|||||||
* fds before freeing the event object.
|
* fds before freeing the event object.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void ssh_event_free(ssh_event event) {
|
void ssh_event_free(ssh_event event)
|
||||||
|
{
|
||||||
int used, i;
|
int used, i;
|
||||||
ssh_poll_handle p;
|
ssh_poll_handle p;
|
||||||
|
|
||||||
if(event == NULL) {
|
if(event == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(event->ctx != NULL) {
|
|
||||||
|
if (event->ctx != NULL) {
|
||||||
used = event->ctx->polls_used;
|
used = event->ctx->polls_used;
|
||||||
for(i = 0; i < used; i++) {
|
for(i = 0; i < used; i++) {
|
||||||
p = event->ctx->pollptrs[i];
|
p = event->ctx->pollptrs[i];
|
||||||
if(p->session != NULL){
|
if (p->session != NULL) {
|
||||||
ssh_poll_ctx_remove(event->ctx, p);
|
ssh_poll_ctx_remove(event->ctx, p);
|
||||||
ssh_poll_ctx_add(p->session->default_poll_ctx, p);
|
ssh_poll_ctx_add(p->session->default_poll_ctx, p);
|
||||||
p->session = NULL;
|
p->session = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user