Skip to content

Commit

Permalink
Fix #2449
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Aug 9, 2019
1 parent e3c6c80 commit 1c4ddd3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,11 +701,6 @@ server_recv_cb(EV_P_ ev_io *w, int revents)

buffer_t *buf = server->buf;

// Ignore any new packet if the server is stopped
if (server->stage == STAGE_STOP) {
return;
}

if (server->stage == STAGE_STREAM) {
remote = server->remote;
buf = remote->buf;
Expand All @@ -731,6 +726,11 @@ server_recv_cb(EV_P_ ev_io *w, int revents)
}
}

// Ignore any new packet if the server is stopped
if (server->stage == STAGE_STOP) {
return;
}

tx += r;
buf->len = r;

Expand Down Expand Up @@ -1101,11 +1101,6 @@ remote_recv_cb(EV_P_ ev_io *w, int revents)
remote_t *remote = remote_recv_ctx->remote;
server_t *server = remote->server;

// Ignore any new packet if the server is stopped
if (server->stage == STAGE_STOP) {
return;
}

if (server == NULL) {
LOGE("invalid server");
close_and_free_remote(EV_A_ remote);
Expand Down Expand Up @@ -1134,6 +1129,11 @@ remote_recv_cb(EV_P_ ev_io *w, int revents)

rx += r;

// Ignore any new packet if the server is stopped
if (server->stage == STAGE_STOP) {
return;
}

server->buf->len = r;
int err = crypto->encrypt(server->buf, server->e_ctx, SOCKET_BUF_SIZE);

Expand Down

0 comments on commit 1c4ddd3

Please sign in to comment.