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
1a2b1d75
Commit
1a2b1d75
authored
Jun 25, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Introduce IOCTL_AFD_WINE_GET_SO_RCVBUF.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b83a8b2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
afd.h
include/wine/afd.h
+1
-0
sock.c
server/sock.c
+25
-2
No files found.
include/wine/afd.h
View file @
1a2b1d75
...
...
@@ -170,6 +170,7 @@ struct afd_get_events_params
#define IOCTL_AFD_WINE_GET_SO_OOBINLINE CTL_CODE(FILE_DEVICE_NETWORK, 227, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_SET_SO_OOBINLINE CTL_CODE(FILE_DEVICE_NETWORK, 228, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_SET_SO_RCVBUF CTL_CODE(FILE_DEVICE_NETWORK, 229, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_AFD_WINE_GET_SO_RCVBUF CTL_CODE(FILE_DEVICE_NETWORK, 230, METHOD_BUFFERED, FILE_ANY_ACCESS)
struct
afd_create_params
{
...
...
server/sock.c
View file @
1a2b1d75
...
...
@@ -207,6 +207,7 @@ struct sock
struct
connect_req
*
connect_req
;
/* pending connection request */
union
win_sockaddr
addr
;
/* socket name */
int
addr_len
;
/* socket name length */
unsigned
int
rcvbuf
;
/* advisory recv buffer size */
unsigned
int
rd_shutdown
:
1
;
/* is the read end shut down? */
unsigned
int
wr_shutdown
:
1
;
/* is the write end shut down? */
unsigned
int
wr_shutdown_pending
:
1
;
/* is a write shutdown pending? */
...
...
@@ -1386,6 +1387,7 @@ static struct sock *create_socket(void)
sock
->
wr_shutdown_pending
=
0
;
sock
->
nonblocking
=
0
;
sock
->
bound
=
0
;
sock
->
rcvbuf
=
0
;
init_async_queue
(
&
sock
->
read_q
);
init_async_queue
(
&
sock
->
write_q
);
init_async_queue
(
&
sock
->
ifchange_q
);
...
...
@@ -1477,7 +1479,8 @@ static void set_dont_fragment( int fd, int level, int value )
static
int
init_socket
(
struct
sock
*
sock
,
int
family
,
int
type
,
int
protocol
,
unsigned
int
flags
)
{
unsigned
int
options
=
0
;
int
sockfd
,
unix_type
,
unix_family
,
unix_protocol
;
int
sockfd
,
unix_type
,
unix_family
,
unix_protocol
,
value
;
socklen_t
len
;
unix_family
=
get_unix_family
(
family
);
unix_type
=
get_unix_type
(
type
);
...
...
@@ -1543,6 +1546,10 @@ static int init_socket( struct sock *sock, int family, int type, int protocol, u
}
#endif
len
=
sizeof
(
value
);
if
(
!
getsockopt
(
sockfd
,
SOL_SOCKET
,
SO_RCVBUF
,
&
value
,
&
len
))
sock
->
rcvbuf
=
value
;
sock
->
state
=
(
type
==
WS_SOCK_STREAM
?
SOCK_UNCONNECTED
:
SOCK_CONNECTIONLESS
);
sock
->
flags
=
flags
;
sock
->
proto
=
protocol
;
...
...
@@ -2580,6 +2587,20 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
return
1
;
}
case
IOCTL_AFD_WINE_GET_SO_RCVBUF
:
{
int
rcvbuf
=
sock
->
rcvbuf
;
if
(
get_reply_max_size
()
<
sizeof
(
rcvbuf
))
{
set_error
(
STATUS_BUFFER_TOO_SMALL
);
return
0
;
}
set_reply_data
(
&
rcvbuf
,
sizeof
(
rcvbuf
)
);
return
1
;
}
case
IOCTL_AFD_WINE_SET_SO_RCVBUF
:
{
DWORD
rcvbuf
;
...
...
@@ -2591,7 +2612,9 @@ static int sock_ioctl( struct fd *fd, ioctl_code_t code, struct async *async )
}
rcvbuf
=
*
(
DWORD
*
)
get_req_data
();
if
(
setsockopt
(
unix_fd
,
SOL_SOCKET
,
SO_RCVBUF
,
(
char
*
)
&
rcvbuf
,
sizeof
(
rcvbuf
)
)
<
0
)
if
(
!
setsockopt
(
unix_fd
,
SOL_SOCKET
,
SO_RCVBUF
,
(
char
*
)
&
rcvbuf
,
sizeof
(
rcvbuf
)
))
sock
->
rcvbuf
=
rcvbuf
;
else
set_error
(
sock_get_ntstatus
(
errno
)
);
return
0
;
}
...
...
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