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
5fc17a28
Commit
5fc17a28
authored
Jul 20, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Handle errors from SSL_read.
parent
be370380
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
net.c
dlls/winhttp/net.c
+19
-5
winhttp.c
dlls/winhttp/tests/winhttp.c
+8
-0
No files found.
dlls/winhttp/net.c
View file @
5fc17a28
...
...
@@ -111,6 +111,7 @@ MAKE_FUNCPTR( SSL_connect );
MAKE_FUNCPTR
(
SSL_shutdown
);
MAKE_FUNCPTR
(
SSL_write
);
MAKE_FUNCPTR
(
SSL_read
);
MAKE_FUNCPTR
(
SSL_get_error
);
MAKE_FUNCPTR
(
SSL_get_ex_new_index
);
MAKE_FUNCPTR
(
SSL_get_ex_data
);
MAKE_FUNCPTR
(
SSL_set_ex_data
);
...
...
@@ -440,6 +441,7 @@ BOOL netconn_init( netconn_t *conn, BOOL secure )
LOAD_FUNCPTR
(
SSL_shutdown
);
LOAD_FUNCPTR
(
SSL_write
);
LOAD_FUNCPTR
(
SSL_read
);
LOAD_FUNCPTR
(
SSL_get_error
);
LOAD_FUNCPTR
(
SSL_get_ex_new_index
);
LOAD_FUNCPTR
(
SSL_get_ex_data
);
LOAD_FUNCPTR
(
SSL_set_ex_data
);
...
...
@@ -713,6 +715,8 @@ BOOL netconn_send( netconn_t *conn, const void *msg, size_t len, int flags, int
BOOL
netconn_recv
(
netconn_t
*
conn
,
void
*
buf
,
size_t
len
,
int
flags
,
int
*
recvd
)
{
int
ret
;
*
recvd
=
0
;
if
(
!
netconn_connected
(
conn
))
return
FALSE
;
if
(
!
len
)
return
TRUE
;
...
...
@@ -751,19 +755,29 @@ BOOL netconn_recv( netconn_t *conn, void *buf, size_t len, int flags, int *recvd
/* check if we have enough data from the peek buffer */
if
(
!
(
flags
&
MSG_WAITALL
)
||
(
*
recvd
==
len
))
return
TRUE
;
}
*
recvd
+=
pSSL_read
(
conn
->
ssl_conn
,
(
char
*
)
buf
+
*
recvd
,
len
-
*
recvd
);
ret
=
pSSL_read
(
conn
->
ssl_conn
,
(
char
*
)
buf
+
*
recvd
,
len
-
*
recvd
);
if
(
ret
<
0
)
return
FALSE
;
/* check if EOF was received */
if
(
!
ret
&&
(
pSSL_get_error
(
conn
->
ssl_conn
,
ret
)
==
SSL_ERROR_ZERO_RETURN
||
pSSL_get_error
(
conn
->
ssl_conn
,
ret
)
==
SSL_ERROR_SYSCALL
))
{
netconn_close
(
conn
);
return
TRUE
;
}
if
(
flags
&
MSG_PEEK
)
/* must copy into buffer */
{
conn
->
peek_len
=
*
recvd
;
if
(
!
*
recvd
)
conn
->
peek_len
=
ret
;
if
(
!
ret
)
{
heap_free
(
conn
->
peek_msg_mem
);
conn
->
peek_msg_mem
=
NULL
;
conn
->
peek_msg
=
NULL
;
}
else
memcpy
(
conn
->
peek_msg
,
buf
,
*
recvd
);
else
memcpy
(
conn
->
peek_msg
,
buf
,
ret
);
}
if
(
*
recvd
<
1
)
return
FALSE
;
*
recvd
=
ret
;
return
TRUE
;
#else
return
FALSE
;
...
...
dlls/winhttp/tests/winhttp.c
View file @
5fc17a28
...
...
@@ -771,6 +771,7 @@ static void test_secure_connection(void)
BOOL
ret
;
CERT_CONTEXT
*
cert
;
WINHTTP_CERTIFICATE_INFO
info
;
char
buffer
[
32
];
ses
=
WinHttpOpen
(
test_useragent
,
0
,
NULL
,
NULL
,
0
);
ok
(
ses
!=
NULL
,
"failed to open session %u
\n
"
,
GetLastError
());
...
...
@@ -847,6 +848,13 @@ static void test_secure_connection(void)
ret
=
WinHttpQueryHeaders
(
req
,
WINHTTP_QUERY_RAW_HEADERS_CRLF
,
NULL
,
NULL
,
&
size
,
NULL
);
ok
(
!
ret
,
"succeeded unexpectedly
\n
"
);
for
(;;)
{
size
=
0
;
ret
=
WinHttpReadData
(
req
,
buffer
,
sizeof
(
buffer
),
&
size
);
if
(
!
size
)
break
;
}
cleanup:
WinHttpCloseHandle
(
req
);
WinHttpCloseHandle
(
con
);
...
...
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