diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-07-07 13:11:57 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-07-07 13:11:57 -0300 |
commit | c801730eda827ea2662ef703f694a2abde33f4c0 (patch) | |
tree | 106ab1053a1364dc440881b4188f6d7974b63b51 | |
parent | 81dd6b162351d93dae5d71a45df56ee1a74a36ca (diff) | |
download | jet-c801730eda827ea2662ef703f694a2abde33f4c0.tar.gz jet-c801730eda827ea2662ef703f694a2abde33f4c0.zip |
Delete restarted clients
-rw-r--r-- | jet.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -64,6 +64,9 @@ int main() { int clientfd = accept(listener, 0, 0); ev.events = EPOLLIN | EPOLLET; ev.data.fd = clientfd; + if (clients[clientfd]) { + delete clients[clientfd]; + } Client *c = new Client(scratch); c->sockfd = clientfd; clients[clientfd] = c; |