Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0ba9567a
Commit
0ba9567a
authored
Oct 31, 2022
by
Paul Gofman
Committed by
Alexandre Julliard
Nov 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http.sys: Use SO_EXCLUSIVEADDRUSE on listening socket.
parent
a9ae1e04
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
http.c
dlls/http.sys/http.c
+3
-1
httpapi.c
dlls/httpapi/tests/httpapi.c
+3
-3
No files found.
dlls/http.sys/http.c
View file @
0ba9567a
...
@@ -715,7 +715,7 @@ static NTSTATUS http_add_url(struct request_queue *queue, IRP *irp)
...
@@ -715,7 +715,7 @@ static NTSTATUS http_add_url(struct request_queue *queue, IRP *irp)
struct
listening_socket
*
listening_sock
;
struct
listening_socket
*
listening_sock
;
char
*
url
,
*
endptr
;
char
*
url
,
*
endptr
;
size_t
queue_url_len
,
new_url_len
;
size_t
queue_url_len
,
new_url_len
;
ULONG
true
=
1
;
ULONG
true
=
1
,
value
;
SOCKET
s
=
INVALID_SOCKET
;
SOCKET
s
=
INVALID_SOCKET
;
TRACE
(
"host %s, context %s.
\n
"
,
debugstr_a
(
params
->
url
),
wine_dbgstr_longlong
(
params
->
context
));
TRACE
(
"host %s, context %s.
\n
"
,
debugstr_a
(
params
->
url
),
wine_dbgstr_longlong
(
params
->
context
));
...
@@ -781,6 +781,8 @@ static NTSTATUS http_add_url(struct request_queue *queue, IRP *irp)
...
@@ -781,6 +781,8 @@ static NTSTATUS http_add_url(struct request_queue *queue, IRP *irp)
addr
.
sin_family
=
AF_INET
;
addr
.
sin_family
=
AF_INET
;
addr
.
sin_addr
.
S_un
.
S_addr
=
INADDR_ANY
;
addr
.
sin_addr
.
S_un
.
S_addr
=
INADDR_ANY
;
value
=
1
;
setsockopt
(
s
,
SOL_SOCKET
,
SO_EXCLUSIVEADDRUSE
,
(
char
*
)
&
value
,
sizeof
(
value
));
if
(
bind
(
s
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
==
-
1
)
if
(
bind
(
s
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
==
-
1
)
{
{
LeaveCriticalSection
(
&
http_cs
);
LeaveCriticalSection
(
&
http_cs
);
...
...
dlls/httpapi/tests/httpapi.c
View file @
0ba9567a
...
@@ -1397,7 +1397,7 @@ static void test_v2_bound_port(void)
...
@@ -1397,7 +1397,7 @@ static void test_v2_bound_port(void)
ok
(
!
ret
,
"Failed to bind to port
\n
"
);
ok
(
!
ret
,
"Failed to bind to port
\n
"
);
swprintf
(
url
,
ARRAY_SIZE
(
url
),
L"http://localhost:%u/"
,
port
);
swprintf
(
url
,
ARRAY_SIZE
(
url
),
L"http://localhost:%u/"
,
port
);
ret
=
pHttpAddUrlToUrlGroup
(
group
,
url
,
0xdeadbeef
,
0
);
ret
=
pHttpAddUrlToUrlGroup
(
group
,
url
,
0xdeadbeef
,
0
);
todo_wine
ok
(
ret
==
ERROR_SHARING_VIOLATION
,
"Unexpected failure adding %s, error %u.
\n
"
,
debugstr_w
(
url
),
ret
);
ok
(
ret
==
ERROR_SHARING_VIOLATION
,
"Unexpected failure adding %s, error %u.
\n
"
,
debugstr_w
(
url
),
ret
);
shutdown
(
s2
,
SD_BOTH
);
shutdown
(
s2
,
SD_BOTH
);
closesocket
(
s2
);
closesocket
(
s2
);
...
@@ -1407,8 +1407,8 @@ static void test_v2_bound_port(void)
...
@@ -1407,8 +1407,8 @@ static void test_v2_bound_port(void)
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
ret
=
connect
(
s
,
(
struct
sockaddr
*
)
&
sockaddr
,
sizeof
(
sockaddr
));
ret
=
connect
(
s
,
(
struct
sockaddr
*
)
&
sockaddr
,
sizeof
(
sockaddr
));
todo_wine
ok
(
ret
,
"Connecting to socket succeeded, %lu.
\n
"
,
GetLastError
());
ok
(
ret
,
"Connecting to socket succeeded, %lu.
\n
"
,
GetLastError
());
todo_wine
ok
(
GetLastError
()
==
WSAECONNREFUSED
,
"Unexpected error connecting to socket, %lu.
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
WSAECONNREFUSED
,
"Unexpected error connecting to socket, %lu.
\n
"
,
GetLastError
());
closesocket
(
s
);
closesocket
(
s
);
ret
=
pHttpCloseRequestQueue
(
dummy_queue
);
ret
=
pHttpCloseRequestQueue
(
dummy_queue
);
...
...
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