Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9eeedc27
Commit
9eeedc27
authored
Aug 14, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Optimize buffer allocation in rpcrt4_ncacn_http_read.
parent
5e6aca79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
rpc_transport.c
dlls/rpcrt4/rpc_transport.c
+8
-7
No files found.
dlls/rpcrt4/rpc_transport.c
View file @
9eeedc27
...
...
@@ -2440,31 +2440,32 @@ static int rpcrt4_ncacn_http_read(RpcConnection *Connection,
unsigned
int
bytes_left
=
count
;
RPC_STATUS
status
=
RPC_S_OK
;
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
);
while
(
bytes_left
)
{
httpc
->
async_data
->
inet_buffers
.
dwBufferLength
=
bytes_left
;
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
bytes_left
);
prepare_async_request
(
httpc
->
async_data
);
ret
=
InternetReadFileExA
(
httpc
->
out_request
,
&
httpc
->
async_data
->
inet_buffers
,
IRF_ASYNC
,
0
);
status
=
wait_async_request
(
httpc
->
async_data
,
ret
,
httpc
->
cancel_event
);
if
(
status
!=
RPC_S_OK
)
{
if
(
status
==
RPC_S_CALL_CANCELLED
)
TRACE
(
"call cancelled
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
);
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
=
NULL
;
break
;
}
memcpy
(
buf
,
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
,
httpc
->
async_data
->
inet_buffers
.
dwBufferLength
);
HeapFree
(
GetProcessHeap
(),
0
,
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
);
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
=
NULL
;
if
(
!
httpc
->
async_data
->
inet_buffers
.
dwBufferLength
)
break
;
memcpy
(
buf
,
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
,
httpc
->
async_data
->
inet_buffers
.
dwBufferLength
);
bytes_left
-=
httpc
->
async_data
->
inet_buffers
.
dwBufferLength
;
buf
+=
httpc
->
async_data
->
inet_buffers
.
dwBufferLength
;
}
HeapFree
(
GetProcessHeap
(),
0
,
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
);
httpc
->
async_data
->
inet_buffers
.
lpvBuffer
=
NULL
;
TRACE
(
"%p %p %u -> %u
\n
"
,
httpc
->
out_request
,
buffer
,
count
,
status
);
return
status
==
RPC_S_OK
?
count
:
-
1
;
}
...
...
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