mirror of
https://git.sr.ht/~sircmpwn/gmnisrv
synced 2024-12-04 14:46:42 -05:00
server: handle write errors
This commit is contained in:
parent
da6f7e9f05
commit
ac6145ed6a
@ -463,7 +463,11 @@ client_writable(struct gmnisrv_server *server, struct gmnisrv_client *client)
|
||||
for (int w = 0; w < r; ) {
|
||||
int q = write(client->sockfd, &buf[w], r - w);
|
||||
if (q < 0) {
|
||||
assert(0); // TODO: handle write errors
|
||||
client_error(&client->addr,
|
||||
"client write: %s",
|
||||
strerror(errno));
|
||||
disconnect_client(server, client);
|
||||
return DISCONNECTED;
|
||||
}
|
||||
w += q;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user