Jacek Caban : server: Store buffer size in pipe_end.

Alexandre Julliard julliard at winehq.org
Mon Mar 20 17:16:47 CDT 2017


Module: wine
Branch: master
Commit: c5afc9f9b61e6f8ef36f9c3971e3b1c3bdbf12e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c5afc9f9b61e6f8ef36f9c3971e3b1c3bdbf12e7

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Mar 15 23:25:31 2017 +0100

server: Store buffer size in pipe_end.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/named_pipe.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/server/named_pipe.c b/server/named_pipe.c
index 55febd7..a75f70b 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -71,6 +71,7 @@ struct pipe_end
     struct fd           *fd;         /* pipe file descriptor */
     unsigned int         flags;      /* pipe flags */
     struct pipe_end     *connection; /* the other end of the pipe */
+    data_size_t          buffer_size;/* size of buffered data that doesn't block caller */
 };
 
 struct pipe_server
@@ -694,11 +695,12 @@ static struct pipe_server *get_pipe_server_obj( struct process *process,
     return (struct pipe_server *) obj;
 }
 
-static void init_pipe_end( struct pipe_end *pipe_end, unsigned int pipe_flags )
+static void init_pipe_end( struct pipe_end *pipe_end, unsigned int pipe_flags, data_size_t buffer_size )
 {
     pipe_end->fd = NULL;
     pipe_end->flags = pipe_flags;
     pipe_end->connection = NULL;
+    pipe_end->buffer_size = buffer_size;
 }
 
 static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned int options,
@@ -714,7 +716,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
     server->client = NULL;
     server->flush_poll = NULL;
     server->options = options;
-    init_pipe_end( &server->pipe_end, pipe_flags );
+    init_pipe_end( &server->pipe_end, pipe_flags, pipe->insize );
 
     list_add_head( &pipe->servers, &server->entry );
     grab_object( pipe );
@@ -728,7 +730,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
     return server;
 }
 
-static struct pipe_client *create_pipe_client( unsigned int flags, unsigned int pipe_flags )
+static struct pipe_client *create_pipe_client( unsigned int flags, unsigned int pipe_flags, data_size_t buffer_size )
 {
     struct pipe_client *client;
 
@@ -738,7 +740,7 @@ static struct pipe_client *create_pipe_client( unsigned int flags, unsigned int
 
     client->server = NULL;
     client->flags = flags;
-    init_pipe_end( &client->pipe_end, pipe_flags );
+    init_pipe_end( &client->pipe_end, pipe_flags, buffer_size );
 
     return client;
 }
@@ -802,7 +804,7 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc
         return NULL;
     }
 
-    if ((client = create_pipe_client( options, pipe->flags )))
+    if ((client = create_pipe_client( options, pipe->flags, pipe->outsize )))
     {
         if (!socketpair( PF_UNIX, SOCK_STREAM, 0, fds ))
         {




More information about the wine-cvs mailing list