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
358e7b7c
Commit
358e7b7c
authored
Nov 30, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Directly return error status from NETCON_recv.
parent
1563c137
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
15 deletions
+14
-15
http.c
dlls/wininet/http.c
+7
-3
internet.h
dlls/wininet/internet.h
+1
-1
netconnection.c
dlls/wininet/netconnection.c
+6
-11
No files found.
dlls/wininet/http.c
View file @
358e7b7c
...
...
@@ -2018,6 +2018,7 @@ static DWORD HTTPREQ_SetOption(object_header_t *hdr, DWORD option, void *buffer,
/* read some more data into the read buffer (the read section must be held) */
static
BOOL
read_more_data
(
http_request_t
*
req
,
int
maxlen
)
{
DWORD
res
;
int
len
;
if
(
req
->
read_pos
)
...
...
@@ -2030,9 +2031,12 @@ static BOOL read_more_data( http_request_t *req, int maxlen )
if
(
maxlen
==
-
1
)
maxlen
=
sizeof
(
req
->
read_buf
);
if
(
!
NETCON_recv
(
&
req
->
netConnection
,
req
->
read_buf
+
req
->
read_size
,
maxlen
-
req
->
read_size
,
0
,
&
len
))
res
=
NETCON_recv
(
&
req
->
netConnection
,
req
->
read_buf
+
req
->
read_size
,
maxlen
-
req
->
read_size
,
0
,
&
len
);
if
(
res
!=
ERROR_SUCCESS
)
{
INTERNET_SetLastError
(
res
);
return
FALSE
;
}
req
->
read_size
+=
len
;
return
TRUE
;
...
...
@@ -2304,7 +2308,7 @@ static DWORD HTTPREQ_Read(http_request_t *req, void *buffer, DWORD size, DWORD *
if
(
size
>
bytes_read
&&
(
!
bytes_read
||
sync
))
{
if
(
NETCON_recv
(
&
req
->
netConnection
,
(
char
*
)
buffer
+
bytes_read
,
size
-
bytes_read
,
sync
?
MSG_WAITALL
:
0
,
&
len
))
sync
?
MSG_WAITALL
:
0
,
&
len
)
==
ERROR_SUCCESS
)
bytes_read
+=
len
;
/* always return success, even if the network layer returns an error */
}
...
...
dlls/wininet/internet.h
View file @
358e7b7c
...
...
@@ -438,7 +438,7 @@ DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *s
DWORD
NETCON_secure_connect
(
WININET_NETCONNECTION
*
connection
,
LPCWSTR
hostname
);
DWORD
NETCON_send
(
WININET_NETCONNECTION
*
connection
,
const
void
*
msg
,
size_t
len
,
int
flags
,
int
*
sent
/* out */
);
BOOL
NETCON_recv
(
WININET_NETCONNECTION
*
connection
,
void
*
buf
,
size_t
len
,
int
flags
,
DWORD
NETCON_recv
(
WININET_NETCONNECTION
*
connection
,
void
*
buf
,
size_t
len
,
int
flags
,
int
*
recvd
/* out */
);
BOOL
NETCON_query_data_available
(
WININET_NETCONNECTION
*
connection
,
DWORD
*
available
);
LPCVOID
NETCON_GetCert
(
WININET_NETCONNECTION
*
connection
);
...
...
dlls/wininet/netconnection.c
View file @
358e7b7c
...
...
@@ -584,30 +584,25 @@ DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len
* Basically calls 'recv()' unless we should use SSL
* number of chars received is put in *recvd
*/
BOOL
NETCON_recv
(
WININET_NETCONNECTION
*
connection
,
void
*
buf
,
size_t
len
,
int
flags
,
DWORD
NETCON_recv
(
WININET_NETCONNECTION
*
connection
,
void
*
buf
,
size_t
len
,
int
flags
,
int
*
recvd
/* out */
)
{
*
recvd
=
0
;
if
(
!
NETCON_connected
(
connection
))
return
FALSE
;
if
(
!
NETCON_connected
(
connection
))
return
ERROR_INTERNET_CONNECTION_ABORTED
;
if
(
!
len
)
return
TRUE
;
return
ERROR_SUCCESS
;
if
(
!
connection
->
useSSL
)
{
*
recvd
=
recv
(
connection
->
socketFD
,
buf
,
len
,
flags
);
if
(
*
recvd
==
-
1
)
{
INTERNET_SetLastError
(
sock_get_error
(
errno
));
return
FALSE
;
}
return
TRUE
;
return
*
recvd
==
-
1
?
sock_get_error
(
errno
)
:
ERROR_SUCCESS
;
}
else
{
#ifdef SONAME_LIBSSL
*
recvd
=
pSSL_read
(
connection
->
ssl_s
,
buf
,
len
);
return
*
recvd
>
0
||
!
len
;
return
*
recvd
>
0
?
ERROR_SUCCESS
:
ERROR_INTERNET_CONNECTION_ABORTED
;
#else
return
FALSE
;
return
ERROR_NOT_SUPPORTED
;
#endif
}
}
...
...
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