sse-multiplex: don't block on client sockets
Rather kill a client connection when the write buffer is full than blocking in sse-multiplexd.
This commit is contained in:
parent
50c763b895
commit
2fc02029b9
|
@ -236,7 +236,7 @@ static void remove_provider(provider_t *p) {
|
|||
}
|
||||
|
||||
static void add_client(provider_t *p, FILE *file) {
|
||||
if (fputs(p->header, file) == EOF || fflush(file) == EOF) {
|
||||
if (fputs(p->header, file) == EOF || fflush(file) == EOF || ferror(file)) {
|
||||
fclose(file);
|
||||
return;
|
||||
}
|
||||
|
@ -415,6 +415,8 @@ static void handle_accept(uint32_t events) {
|
|||
return;
|
||||
}
|
||||
|
||||
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
|
||||
|
||||
provider_t *p = get_provider(command);
|
||||
if (!p) {
|
||||
fclose(file);
|
||||
|
|
Loading…
Reference in New Issue