proxy: Switch to blocking I/O with signal handlers to exit.

It's safe to terminate the proxy at any point in its lifecycle, so
there's no point using signalfd() (and the associated select() +
non-blocking I/O gubbins) in it. We might want to use non-blocking
I/O in the future for other reasons, of course, at which point it
might become sensible to use signalfd() again. For now, this makes
us reliably responsive to TERM,INT and QUIT in a way that we weren't
previously.
This commit is contained in:
nick
2013-03-19 14:39:04 +00:00
parent 5257e93cb7
commit e994b80756
3 changed files with 76 additions and 140 deletions

View File

@@ -55,19 +55,16 @@ struct proxier {
/* We transform the raw reply header into here */
struct nbd_reply rsp_hdr;
/* File descriptor that signal handlers write to */
int signal_fd;
};
struct proxier* proxy_create(
int signal_fd,
char* s_downstream_address,
char* s_downstream_port,
char* s_upstream_address,
char* s_upstream_port,
char* s_upstream_bind );
int do_proxy( struct proxier* proxy );
void proxy_cleanup( struct proxier* proxy );
void proxy_destroy( struct proxier* proxy );
#endif