Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Herman Semenov
wine
Commits
e6f45145
Commit
e6f45145
authored
18 years ago
by
Robert Shearman
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rpcrt4: Try to avoid partial named pipe read/writes by looping.
parent
9fb15b41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/rpcrt4/rpc_transport.c
+28
-9
28 additions, 9 deletions
dlls/rpcrt4/rpc_transport.c
with
28 additions
and
9 deletions
dlls/rpcrt4/rpc_transport.c
+
28
−
9
View file @
e6f45145
...
...
@@ -354,21 +354,40 @@ static int rpcrt4_conn_np_read(RpcConnection *Connection,
void
*
buffer
,
unsigned
int
count
)
{
RpcConnection_np
*
npc
=
(
RpcConnection_np
*
)
Connection
;
DWORD
dwRead
=
0
;
if
(
!
ReadFile
(
npc
->
pipe
,
buffer
,
count
,
&
dwRead
,
NULL
)
&&
(
GetLastError
()
!=
ERROR_MORE_DATA
))
return
-
1
;
return
dwRead
;
char
*
buf
=
buffer
;
BOOL
ret
=
TRUE
;
unsigned
int
bytes_left
=
count
;
while
(
bytes_left
)
{
DWORD
bytes_read
;
ret
=
ReadFile
(
npc
->
pipe
,
buf
,
bytes_left
,
&
bytes_read
,
NULL
);
if
(
!
ret
||
!
bytes_read
)
break
;
bytes_left
-=
bytes_read
;
buf
+=
bytes_read
;
}
return
ret
?
count
:
-
1
;
}
static
int
rpcrt4_conn_np_write
(
RpcConnection
*
Connection
,
const
void
*
buffer
,
unsigned
int
count
)
{
RpcConnection_np
*
npc
=
(
RpcConnection_np
*
)
Connection
;
DWORD
dwWritten
=
0
;
if
(
!
WriteFile
(
npc
->
pipe
,
buffer
,
count
,
&
dwWritten
,
NULL
))
return
-
1
;
return
dwWritten
;
const
char
*
buf
=
buffer
;
BOOL
ret
=
TRUE
;
unsigned
int
bytes_left
=
count
;
while
(
bytes_left
)
{
DWORD
bytes_written
;
ret
=
WriteFile
(
npc
->
pipe
,
buf
,
count
,
&
bytes_written
,
NULL
);
if
(
!
ret
||
!
bytes_written
)
break
;
bytes_left
-=
bytes_written
;
buf
+=
bytes_written
;
}
return
ret
?
count
:
-
1
;
}
static
int
rpcrt4_conn_np_close
(
RpcConnection
*
Connection
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment