flexnbd serve: Make the killswitch per-client-thread
This is a bit tricky, but calling shutdown() on a socket in a signal handler is safe, and (at least in linux) appears to cause any read() or write() calls blocked on that socket to return, even with SA_RESTART. I'm not confident enough about the rest of flexnbd's syscall error handling to turn SA_RESTART off for this signal...
This commit is contained in:
@@ -58,6 +58,7 @@ struct client {
|
||||
|
||||
};
|
||||
|
||||
void client_killswitch_hit(int signal, siginfo_t *info, void *ptr);
|
||||
|
||||
void* client_serve(void* client_uncast);
|
||||
struct client * client_create( struct server * serve, int socket );
|
||||
|
Reference in New Issue
Block a user