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
9d7d27ea
Commit
9d7d27ea
authored
Jun 18, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Don't use blocking_mode_t in netconn.c.
parent
6fe55462
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
27 deletions
+20
-27
http.c
dlls/wininet/http.c
+6
-0
internet.h
dlls/wininet/internet.h
+0
-6
netconnection.c
dlls/wininet/netconnection.c
+14
-21
No files found.
dlls/wininet/http.c
View file @
9d7d27ea
...
...
@@ -380,6 +380,12 @@ static WCHAR *get_host_header( http_request_t *req )
return
ret
;
}
typedef
enum
{
BLOCKING_ALLOW
,
BLOCKING_DISALLOW
,
BLOCKING_WAITALL
}
blocking_mode_t
;
struct
data_stream_vtbl_t
{
DWORD
(
*
get_avail_data
)(
data_stream_t
*
,
http_request_t
*
);
BOOL
(
*
end_of_data
)(
data_stream_t
*
,
http_request_t
*
);
...
...
dlls/wininet/internet.h
View file @
9d7d27ea
...
...
@@ -415,12 +415,6 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD
dwStatusInfoLength
)
DECLSPEC_HIDDEN
;
BOOL
INTERNET_FindProxyForProtocol
(
LPCWSTR
szProxy
,
LPCWSTR
proto
,
WCHAR
*
foundProxy
,
DWORD
*
foundProxyLen
)
DECLSPEC_HIDDEN
;
typedef
enum
{
BLOCKING_ALLOW
,
BLOCKING_DISALLOW
,
BLOCKING_WAITALL
}
blocking_mode_t
;
DWORD
create_netconn
(
BOOL
,
server_t
*
,
DWORD
,
BOOL
,
DWORD
,
netconn_t
**
)
DECLSPEC_HIDDEN
;
void
free_netconn
(
netconn_t
*
)
DECLSPEC_HIDDEN
;
void
NETCON_unload
(
void
)
DECLSPEC_HIDDEN
;
...
...
dlls/wininet/netconnection.c
View file @
9d7d27ea
...
...
@@ -280,9 +280,9 @@ void init_winsock(void)
InitOnceExecuteOnce
(
&
init_once
,
winsock_startup
,
NULL
,
NULL
);
}
static
void
set_socket_blocking
(
int
socket
,
blocking_mode_t
mode
)
static
void
set_socket_blocking
(
int
socket
,
BOOL
is_blocking
)
{
ULONG
arg
=
mode
==
BLOCKING_DISALLOW
;
ULONG
arg
=
!
is_blocking
;
ioctlsocket
(
socket
,
FIONBIO
,
&
arg
);
}
...
...
@@ -297,7 +297,7 @@ static DWORD create_netconn_socket(server_t *server, netconn_t *netconn, DWORD t
assert
(
server
->
addr_len
);
result
=
netconn
->
socket
=
socket
(
server
->
addr
.
ss_family
,
SOCK_STREAM
,
0
);
if
(
result
!=
-
1
)
{
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_DISALLOW
);
set_socket_blocking
(
netconn
->
socket
,
FALSE
);
result
=
connect
(
netconn
->
socket
,
(
struct
sockaddr
*
)
&
server
->
addr
,
server
->
addr_len
);
if
(
result
==
-
1
)
{
...
...
@@ -326,7 +326,7 @@ static DWORD create_netconn_socket(server_t *server, netconn_t *netconn, DWORD t
netconn
->
socket
=
-
1
;
}
else
{
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_ALLOW
);
set_socket_blocking
(
netconn
->
socket
,
TRUE
);
}
}
if
(
result
==
-
1
)
...
...
@@ -688,22 +688,17 @@ DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags,
}
}
static
BOOL
read_ssl_chunk
(
netconn_t
*
conn
,
void
*
buf
,
SIZE_T
buf_size
,
blocking_mode_t
mode
,
SIZE_T
*
ret_size
,
BOOL
*
eof
)
static
BOOL
read_ssl_chunk
(
netconn_t
*
conn
,
void
*
buf
,
SIZE_T
buf_size
,
BOOL
blocking
,
SIZE_T
*
ret_size
,
BOOL
*
eof
)
{
const
SIZE_T
ssl_buf_size
=
conn
->
ssl_sizes
.
cbHeader
+
conn
->
ssl_sizes
.
cbMaximumMessage
+
conn
->
ssl_sizes
.
cbTrailer
;
SecBuffer
bufs
[
4
];
SecBufferDesc
buf_desc
=
{
SECBUFFER_VERSION
,
sizeof
(
bufs
)
/
sizeof
(
*
bufs
),
bufs
};
SSIZE_T
size
,
buf_len
=
0
;
blocking_mode_t
tmp_mode
;
int
i
;
SECURITY_STATUS
res
;
assert
(
conn
->
extra_len
<
ssl_buf_size
);
/* BLOCKING_WAITALL is handled by caller */
if
(
mode
==
BLOCKING_WAITALL
)
mode
=
BLOCKING_ALLOW
;
if
(
conn
->
extra_len
)
{
memcpy
(
conn
->
ssl_buf
,
conn
->
extra_buf
,
conn
->
extra_len
);
buf_len
=
conn
->
extra_len
;
...
...
@@ -712,8 +707,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking
conn
->
extra_buf
=
NULL
;
}
tmp_mode
=
buf_len
?
BLOCKING_DISALLOW
:
mode
;
set_socket_blocking
(
conn
->
socket
,
tmp_mode
);
set_socket_blocking
(
conn
->
socket
,
blocking
&&
!
buf_len
);
size
=
sock_recv
(
conn
->
socket
,
conn
->
ssl_buf
+
buf_len
,
ssl_buf_size
-
buf_len
,
0
);
if
(
size
<
0
)
{
if
(
!
buf_len
)
{
...
...
@@ -728,11 +722,10 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking
buf_len
+=
size
;
}
*
ret_size
=
buf_len
;
if
(
!
buf_len
)
{
TRACE
(
"EOF
\n
"
);
*
eof
=
TRUE
;
*
ret_size
=
0
;
return
ERROR_SUCCESS
;
}
...
...
@@ -755,7 +748,7 @@ static BOOL read_ssl_chunk(netconn_t *conn, void *buf, SIZE_T buf_size, blocking
case
SEC_E_INCOMPLETE_MESSAGE
:
assert
(
buf_len
<
ssl_buf_size
);
set_socket_blocking
(
conn
->
socket
,
mode
);
set_socket_blocking
(
conn
->
socket
,
blocking
);
size
=
sock_recv
(
conn
->
socket
,
conn
->
ssl_buf
+
buf_len
,
ssl_buf_size
-
buf_len
,
0
);
if
(
size
<
1
)
{
if
(
size
<
0
&&
WSAGetLastError
()
==
WSAEWOULDBLOCK
)
{
...
...
@@ -826,9 +819,9 @@ DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, BOOL blocking, i
if
(
!
connection
->
secure
)
{
set_socket_blocking
(
connection
->
socket
,
blocking
?
BLOCKING_ALLOW
:
BLOCKING_DISALLOW
);
*
recvd
=
sock_recv
(
connection
->
socket
,
buf
,
len
,
0
);
return
*
recvd
==
-
1
?
WSAGetLastError
()
:
ERROR_SUCCESS
;
set_socket_blocking
(
connection
->
socket
,
blocking
);
*
recvd
=
sock_recv
(
connection
->
socket
,
buf
,
len
,
0
);
return
*
recvd
==
-
1
?
WSAGetLastError
()
:
ERROR_SUCCESS
;
}
else
{
...
...
@@ -852,7 +845,7 @@ DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, BOOL blocking, i
}
do
{
res
=
read_ssl_chunk
(
connection
,
(
BYTE
*
)
buf
+
size
,
len
-
size
,
blocking
?
BLOCKING_ALLOW
:
BLOCKING_DISALLOW
,
&
size
,
&
eof
);
res
=
read_ssl_chunk
(
connection
,
(
BYTE
*
)
buf
,
len
,
blocking
,
&
size
,
&
eof
);
if
(
res
!=
ERROR_SUCCESS
)
{
if
(
res
==
WSAEWOULDBLOCK
)
{
if
(
size
)
...
...
@@ -901,9 +894,9 @@ BOOL NETCON_is_alive(netconn_t *netconn)
int
len
;
char
b
;
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_DISALLOW
);
set_socket_blocking
(
netconn
->
socket
,
FALSE
);
len
=
sock_recv
(
netconn
->
socket
,
&
b
,
1
,
MSG_PEEK
);
set_socket_blocking
(
netconn
->
socket
,
BLOCKING_ALLOW
);
set_socket_blocking
(
netconn
->
socket
,
TRUE
);
return
len
==
1
||
(
len
==
-
1
&&
WSAGetLastError
()
==
WSAEWOULDBLOCK
);
}
...
...
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