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
1b8d8ef3
Commit
1b8d8ef3
authored
May 29, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Use a helper to send data and take care of EINTR.
parent
3c160444
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
ftp.c
dlls/wininet/ftp.c
+4
-4
internet.h
dlls/wininet/internet.h
+1
-0
netconnection.c
dlls/wininet/netconnection.c
+14
-3
No files found.
dlls/wininet/ftp.c
View file @
1b8d8ef3
...
...
@@ -1220,7 +1220,7 @@ static DWORD FTPFILE_WriteFile(object_header_t *hdr, const void *buffer, DWORD s
ftp_file_t
*
lpwh
=
(
ftp_file_t
*
)
hdr
;
int
res
;
res
=
send
(
lpwh
->
nDataSocket
,
buffer
,
size
,
0
);
res
=
s
ock_s
end
(
lpwh
->
nDataSocket
,
buffer
,
size
,
0
);
*
written
=
res
>
0
?
res
:
0
;
return
res
>=
0
?
ERROR_SUCCESS
:
sock_get_error
(
errno
);
...
...
@@ -2316,7 +2316,7 @@ BOOL WINAPI FtpCommandW( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags
TRACE
(
"Sending (%s) len(%d)
\n
"
,
cmd
,
len
);
while
((
nBytesSent
<
len
)
&&
(
nRC
!=
-
1
))
{
nRC
=
send
(
lpwfs
->
sndSocket
,
cmd
+
nBytesSent
,
len
-
nBytesSent
,
0
);
nRC
=
s
ock_s
end
(
lpwfs
->
sndSocket
,
cmd
+
nBytesSent
,
len
-
nBytesSent
,
0
);
if
(
nRC
!=
-
1
)
{
nBytesSent
+=
nRC
;
...
...
@@ -2683,7 +2683,7 @@ static BOOL FTP_SendCommandA(INT nSocket, FTP_COMMAND ftpCmd, LPCSTR lpszParam,
TRACE
(
"Sending (%s) len(%d)
\n
"
,
buf
,
len
);
while
((
nBytesSent
<
len
)
&&
(
nRC
!=
-
1
))
{
nRC
=
send
(
nSocket
,
buf
+
nBytesSent
,
len
-
nBytesSent
,
0
);
nRC
=
s
ock_s
end
(
nSocket
,
buf
+
nBytesSent
,
len
-
nBytesSent
,
0
);
nBytesSent
+=
nRC
;
}
heap_free
(
buf
);
...
...
@@ -3263,7 +3263,7 @@ static BOOL FTP_SendData(ftp_session_t *lpwfs, INT nDataSocket, HANDLE hFile)
nLen
=
DATA_PACKET_SIZE
<
nBytesToSend
?
DATA_PACKET_SIZE
:
nBytesToSend
;
nRC
=
send
(
nDataSocket
,
lpszBuffer
,
nLen
,
0
);
nRC
=
s
ock_s
end
(
nDataSocket
,
lpszBuffer
,
nLen
,
0
);
if
(
nRC
!=
-
1
)
{
...
...
dlls/wininet/internet.h
View file @
1b8d8ef3
...
...
@@ -457,6 +457,7 @@ LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN;
int
NETCON_GetCipherStrength
(
netconn_t
*
)
DECLSPEC_HIDDEN
;
DWORD
NETCON_set_timeout
(
netconn_t
*
connection
,
BOOL
send
,
DWORD
value
)
DECLSPEC_HIDDEN
;
int
sock_get_error
(
int
)
DECLSPEC_HIDDEN
;
int
sock_send
(
int
fd
,
const
void
*
msg
,
size_t
len
,
int
flags
)
DECLSPEC_HIDDEN
;
server_t
*
get_server
(
const
WCHAR
*
,
INTERNET_PORT
,
BOOL
,
BOOL
);
...
...
dlls/wininet/netconnection.c
View file @
1b8d8ef3
...
...
@@ -496,6 +496,17 @@ int sock_get_error( int err )
return
err
;
}
int
sock_send
(
int
fd
,
const
void
*
msg
,
size_t
len
,
int
flags
)
{
int
ret
;
do
{
ret
=
send
(
fd
,
msg
,
len
,
flags
);
}
while
(
ret
==
-
1
&&
errno
==
EINTR
);
return
ret
;
}
static
void
set_socket_blocking
(
int
socket
,
blocking_mode_t
mode
)
{
#if defined(__MINGW32__) || defined (_MSC_VER)
...
...
@@ -546,7 +557,7 @@ static DWORD netcon_secure_connect_setup(netconn_t *connection, BOOL compat_mode
TRACE
(
"sending %u bytes
\n
"
,
out_buf
.
cbBuffer
);
size
=
send
(
connection
->
socket
,
out_buf
.
pvBuffer
,
out_buf
.
cbBuffer
,
0
);
size
=
s
ock_s
end
(
connection
->
socket
,
out_buf
.
pvBuffer
,
out_buf
.
cbBuffer
,
0
);
if
(
size
!=
out_buf
.
cbBuffer
)
{
ERR
(
"send failed
\n
"
);
status
=
ERROR_INTERNET_SECURITY_CHANNEL_ERROR
;
...
...
@@ -718,7 +729,7 @@ static BOOL send_ssl_chunk(netconn_t *conn, const void *msg, size_t size)
return
FALSE
;
}
if
(
send
(
conn
->
socket
,
conn
->
ssl_buf
,
bufs
[
0
].
cbBuffer
+
bufs
[
1
].
cbBuffer
+
bufs
[
2
].
cbBuffer
,
0
)
<
1
)
{
if
(
s
ock_s
end
(
conn
->
socket
,
conn
->
ssl_buf
,
bufs
[
0
].
cbBuffer
+
bufs
[
1
].
cbBuffer
+
bufs
[
2
].
cbBuffer
,
0
)
<
1
)
{
WARN
(
"send failed
\n
"
);
return
FALSE
;
}
...
...
@@ -736,7 +747,7 @@ DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags,
{
if
(
!
connection
->
secure
)
{
*
sent
=
send
(
connection
->
socket
,
msg
,
len
,
flags
);
*
sent
=
s
ock_s
end
(
connection
->
socket
,
msg
,
len
,
flags
);
if
(
*
sent
==
-
1
)
return
sock_get_error
(
errno
);
return
ERROR_SUCCESS
;
...
...
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