mirror of
https://github.com/wassname/ray.git
synced 2026-07-31 12:41:01 +08:00
Fix bug with reused file descriptors (#471)
* Fix bug with reused file descriptors * Remove client connection if write_object_chunk fails * Handle ECONNRESET on unsuccessful write * lint * Back to lowercase * fix compilation * fix linting
This commit is contained in:
committed by
Philipp Moritz
parent
2bbfc5da8d
commit
e50a23b820
@@ -20,7 +20,7 @@ void event_loop_destroy(event_loop *loop) {
|
||||
aeDeleteEventLoop(loop);
|
||||
}
|
||||
|
||||
void event_loop_add_file(event_loop *loop,
|
||||
bool event_loop_add_file(event_loop *loop,
|
||||
int fd,
|
||||
int events,
|
||||
event_loop_file_handler handler,
|
||||
@@ -30,11 +30,13 @@ void event_loop_add_file(event_loop *loop,
|
||||
/* If it cannot be added, increase the size of the event loop. */
|
||||
if (err == AE_ERR && errno == ERANGE) {
|
||||
err = aeResizeSetSize(loop, 3 * aeGetSetSize(loop) / 2);
|
||||
CHECK(err == AE_OK);
|
||||
if (err != AE_OK) {
|
||||
return false;
|
||||
}
|
||||
err = aeCreateFileEvent(loop, fd, events, handler, context);
|
||||
}
|
||||
/* In any case, test if there were errors. */
|
||||
CHECK(err == AE_OK);
|
||||
return (err == AE_OK);
|
||||
}
|
||||
|
||||
void event_loop_remove_file(event_loop *loop, int fd) {
|
||||
|
||||
Reference in New Issue
Block a user