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
0b78af7c
Commit
0b78af7c
authored
Jan 31, 1999
by
Geoff Clare
Committed by
Alexandre Julliard
Jan 31, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to allow for recvmsg() returning less data than is needed.
parent
e27326a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
6 deletions
+32
-6
client.c
scheduler/client.c
+32
-6
No files found.
scheduler/client.c
View file @
0b78af7c
...
...
@@ -170,17 +170,43 @@ static unsigned int CLIENT_WaitReply_v( int *len, int *passed_fd,
if
(
len
)
*
len
=
ret
-
sizeof
(
head
);
if
(
pass_fd
!=
-
1
)
close
(
pass_fd
);
remaining
=
head
.
len
-
ret
;
while
(
remaining
>
0
)
/*
drop
remaining data */
while
(
remaining
>
0
)
/*
get
remaining data */
{
char
buffer
[
1024
];
int
len
=
remaining
<
sizeof
(
buffer
)
?
remaining
:
sizeof
(
buffer
);
if
((
len
=
recv
(
thdb
->
socket
,
buffer
,
len
,
0
))
==
-
1
)
char
*
bufp
,
buffer
[
1024
];
int
addlen
,
i
,
iovtot
=
0
;
/* see if any iovs are still incomplete, otherwise drop the rest */
for
(
i
=
0
;
i
<
veclen
&&
remaining
>
0
;
i
++
)
{
if
(
iovtot
+
vec
[
i
].
iov_len
>
head
.
len
-
remaining
)
{
addlen
=
iovtot
+
vec
[
i
].
iov_len
-
(
head
.
len
-
remaining
);
bufp
=
(
char
*
)
vec
[
i
].
iov_base
+
(
vec
[
i
].
iov_len
-
addlen
);
if
(
addlen
>
remaining
)
addlen
=
remaining
;
if
((
addlen
=
recv
(
thdb
->
socket
,
bufp
,
addlen
,
0
))
==
-
1
)
{
perror
(
"recv"
);
CLIENT_ProtocolError
(
"recv
\n
"
);
}
if
(
!
addlen
)
ExitThread
(
1
);
/* the server closed the connection; time to die... */
if
(
len
)
*
len
+=
addlen
;
remaining
-=
addlen
;
}
iovtot
+=
vec
[
i
].
iov_len
;
}
if
(
remaining
>
0
)
addlen
=
remaining
<
sizeof
(
buffer
)
?
remaining
:
sizeof
(
buffer
);
else
break
;
if
((
addlen
=
recv
(
thdb
->
socket
,
buffer
,
addlen
,
0
))
==
-
1
)
{
perror
(
"recv"
);
CLIENT_ProtocolError
(
"recv
\n
"
);
}
if
(
!
len
)
ExitThread
(
1
);
/* the server closed the connection; time to die... */
remaining
-=
len
;
if
(
!
add
len
)
ExitThread
(
1
);
/* the server closed the connection; time to die... */
remaining
-=
add
len
;
}
SetLastError
(
head
.
type
);
...
...
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