Cygwin: FIFO: change the fifo_client_connect_state enum
Make the values correspond to the possible return values of fifo_client_handler::pipe_state(). When cleaning up the fc_handler list in listen_client_thread(), don't delete handlers in the fc_closing state. I think the pipe might still have input to be read in that case. Set the state to fc_closing later in the same function if a connection is made and the status returned by NtFsControlFile is STATUS_PIPE_CLOSING. In raw_read, don't error out if NtReadFile returns an unexpected status; just set the state of that handler to fc_error. One writer in a bad state doesn't justify giving up on reading.
This commit is contained in:
@@ -1270,11 +1270,16 @@ public:
|
||||
#define CYGWIN_FIFO_PIPE_NAME_LEN 47
|
||||
#define MAX_CLIENTS 64
|
||||
|
||||
/* The last three are the ones we try to read from. */
|
||||
enum fifo_client_connect_state
|
||||
{
|
||||
fc_unknown,
|
||||
fc_error,
|
||||
fc_disconnected,
|
||||
fc_listening,
|
||||
fc_connected,
|
||||
fc_invalid
|
||||
fc_closing,
|
||||
fc_input_avail,
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -1316,7 +1321,8 @@ class fhandler_fifo: public fhandler_base
|
||||
bool listen_client ();
|
||||
int stop_listen_client ();
|
||||
int check_listen_client_thread ();
|
||||
void record_connection (fifo_client_handler&);
|
||||
void record_connection (fifo_client_handler&,
|
||||
fifo_client_connect_state = fc_connected);
|
||||
public:
|
||||
fhandler_fifo ();
|
||||
bool hit_eof ();
|
||||
|
Reference in New Issue
Block a user