Make read_ready a manual reset event. It should always be set shortly
after startup of the listen_client thread and remain set until the
thread terminates. (We don't want writers to connect without being
recorded in the client handler list.)
Remove the unnecessary code that checks for read_ready
Otherwise it doesn't get started until the dup'd fd tries to read,
which delays client connections.
---
winsup/cygwin/fhandler_fifo.cc | 22 +-
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index a
Remove fifo_client_handler::connect and move its code into
listen_client_thread. That way we can check the return status when a
client handler's connect_evt is signaled. Previously we incorrectly
assumed there was a successful connection.
Also simplify listen_client_thread in the following ways:
If NtReadFile returns STATUS_PENDING, wait for the read to complete.
This can happen, for instance, in the case of a FIFO opened with
O_RDRW.
---
winsup/cygwin/fhandler.cc | 14 +-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/f
The second check of nconnected needs to be protected by a lock as well
as the first.
---
winsup/cygwin/fhandler_fifo.cc | 21 +
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 901696444..70551e
There may be short periods when there's no pipe instance available.
Keep trying.
---
winsup/cygwin/fhandler_fifo.cc | 52 --
1 file changed, 31 insertions(+), 21 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 479021e
Make sure that fhandler_base::close rather than fhandler_fifo::close
is called on the fhandler. Also, delete the fhandler, since we
allocated it.
---
winsup/cygwin/fhandler_fifo.cc | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygw
If the pipe is empty, we can get either ERROR_NO_DATA or
ERROR_PIPE_LISTENING.
---
winsup/cygwin/fhandler_fifo.cc | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 764420ffd..2da579b95 100644
---
After copyto is called, make the new fhandler's pipe_name point to the
new fhandler's pipe_name_buf, which is a *copy* of the old fhandler's
pipe_name_buf. Previously, get_pipe_name would return the wrong
result after a clone/dup, causing create_pipe_instance and open_pipe
to fail.
Also, stop the
Don't set the write end of the pipe to non-blocking mode if the FIFO
is opened in blocking mode.
In fhandler_fifo::raw_write in blocking mode, wait for the write to
complete rather than returning -1 with EAGAIN.
If the amount to write is large, write in smaller chunks (of size
determined by a new
Rename fhandler_fifo::get_handle(int) to get_fc_handle(int), and
remove fhandler_fifo::get_handle(void).
---
winsup/cygwin/fhandler.h | 7 ---
winsup/cygwin/select.cc | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
ind
The word "client" suggests something that holds a handle to the client
side of the pipe (in Windows terminology). But our
fifo_client_handlers hold a handle the server side of the pipe, and
they *connect* to clients.
---
winsup/cygwin/fhandler.h | 20 +++
winsup/cygwin/fhandler_fifo.cc
Add data members 'reader', 'writer', and 'duplexer' to the
fhandler_fifo class. Set them in fhandler_fifo::open. ('duplexer'
replaces the previous '_duplexer'.)
This will be useful in later commits.
---
winsup/cygwin/fhandler.h | 2 +-
winsup/cygwin/fhandler_fifo.cc | 14 --
Ken Brown (14):
Cygwin: FIFO: rename client[] to fc_handler[]
Cygwin: FIFO: hit_eof: add a call to fifo_client_lock
Cygwin: FIFO: remember the type of the fhandler
Cygwin: FIFO: fix a thinko in listen_client_thread
Cygwin: FIFO: fix the error checking in raw_read
Cygwin: check for STATU
---
winsup/cygwin/fhandler_fifo.cc | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 258c3cf8a..764420ffd 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -362,7 +362,10 @
15 matches
Mail list logo