Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
316112e3
Commit
316112e3
authored
Mar 15, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store connected pipe_end in pipe_end struct.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1f765fb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
named_pipe.c
server/named_pipe.c
+26
-0
No files found.
server/named_pipe.c
View file @
316112e3
...
...
@@ -70,6 +70,7 @@ struct pipe_end
struct
object
obj
;
/* object header */
struct
fd
*
fd
;
/* pipe file descriptor */
unsigned
int
flags
;
/* pipe flags */
struct
pipe_end
*
connection
;
/* the other end of the pipe */
};
struct
pipe_server
...
...
@@ -368,6 +369,19 @@ static void notify_empty( struct pipe_server *server )
fd_async_wake_up
(
server
->
pipe_end
.
fd
,
ASYNC_TYPE_WAIT
,
STATUS_SUCCESS
);
}
static
void
pipe_end_disconnect
(
struct
pipe_end
*
pipe_end
,
unsigned
int
status
)
{
struct
pipe_end
*
connection
=
pipe_end
->
connection
;
pipe_end
->
connection
=
NULL
;
if
(
connection
)
{
connection
->
connection
=
NULL
;
pipe_end_disconnect
(
connection
,
status
);
}
}
static
void
do_disconnect
(
struct
pipe_server
*
server
)
{
/* we may only have a server fd, if the client disconnected */
...
...
@@ -390,6 +404,8 @@ static void pipe_server_destroy( struct object *obj)
assert
(
obj
->
ops
==
&
pipe_server_ops
);
pipe_end_disconnect
(
&
server
->
pipe_end
,
STATUS_PIPE_BROKEN
);
if
(
server
->
pipe_end
.
fd
)
{
notify_empty
(
server
);
...
...
@@ -417,6 +433,8 @@ static void pipe_client_destroy( struct object *obj)
assert
(
obj
->
ops
==
&
pipe_client_ops
);
pipe_end_disconnect
(
&
client
->
pipe_end
,
STATUS_PIPE_BROKEN
);
if
(
server
)
{
notify_empty
(
server
);
...
...
@@ -641,6 +659,7 @@ static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct
notify_empty
(
server
);
/* dump the client and server fds - client loses all waiting data */
pipe_end_disconnect
(
&
server
->
pipe_end
,
STATUS_PIPE_DISCONNECTED
);
do_disconnect
(
server
);
server
->
client
->
server
=
NULL
;
server
->
client
=
NULL
;
...
...
@@ -648,6 +667,7 @@ static obj_handle_t pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct
break
;
case
ps_wait_disconnect
:
assert
(
!
server
->
client
);
pipe_end_disconnect
(
&
server
->
pipe_end
,
STATUS_PIPE_DISCONNECTED
);
do_disconnect
(
server
);
set_server_state
(
server
,
ps_wait_connect
);
break
;
...
...
@@ -678,6 +698,7 @@ static void init_pipe_end( struct pipe_end *pipe_end, unsigned int pipe_flags )
{
pipe_end
->
fd
=
NULL
;
pipe_end
->
flags
=
pipe_flags
;
pipe_end
->
connection
=
NULL
;
}
static
struct
pipe_server
*
create_pipe_server
(
struct
named_pipe
*
pipe
,
unsigned
int
options
,
...
...
@@ -829,6 +850,11 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc
release_object
(
client
);
client
=
NULL
;
}
if
(
client
)
{
server
->
pipe_end
.
connection
=
&
client
->
pipe_end
;
client
->
pipe_end
.
connection
=
&
server
->
pipe_end
;
}
}
release_object
(
server
);
return
&
client
->
pipe_end
.
obj
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment