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
73646d35
Commit
73646d35
authored
Jul 23, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Use an offset instead of a pointer for the write position.
parent
f87745d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
request.c
dlls/winhttp/request.c
+7
-7
No files found.
dlls/winhttp/request.c
View file @
73646d35
...
...
@@ -2157,7 +2157,7 @@ struct winhttp_request
HANDLE
wait
;
HANDLE
cancel
;
char
*
buffer
;
char
*
ptr
;
DWORD
offset
;
DWORD
bytes_available
;
DWORD
bytes_read
;
LONG
resolve_timeout
;
...
...
@@ -2624,7 +2624,6 @@ static DWORD request_read_body( struct winhttp_request *request, DWORD timeout )
if
(
!
(
request
->
buffer
=
heap_alloc
(
buflen
)))
return
E_OUTOFMEMORY
;
size
=
total_bytes_read
=
0
;
request
->
ptr
=
request
->
buffer
;
do
{
wait_set_status_callback
(
request
,
WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE
);
...
...
@@ -2648,14 +2647,15 @@ static DWORD request_read_body( struct winhttp_request *request, DWORD timeout )
request
->
buffer
=
tmp
;
}
wait_set_status_callback
(
request
,
WINHTTP_CALLBACK_STATUS_READ_COMPLETE
);
if
(
!
WinHttpReadData
(
request
->
hrequest
,
request
->
ptr
,
request
->
bytes_available
,
&
request
->
bytes_read
))
if
(
!
WinHttpReadData
(
request
->
hrequest
,
request
->
buffer
+
request
->
offset
,
request
->
bytes_available
,
&
request
->
bytes_read
))
{
err
=
GetLastError
();
goto
error
;
}
wait_for_completion
(
request
,
timeout
);
total_bytes_read
+=
request
->
bytes_read
;
request
->
ptr
+=
request
->
bytes_read
;
request
->
offset
+=
request
->
bytes_read
;
}
while
(
request
->
bytes_read
);
request
->
state
=
REQUEST_STATE_BODY_RECEIVED
;
...
...
@@ -2713,9 +2713,9 @@ static HRESULT WINAPI winhttp_request_get_ResponseText(
if
((
err
=
request_read_body
(
request
,
INFINITE
)))
return
HRESULT_FROM_WIN32
(
err
);
if
((
err
=
request_get_codepage
(
request
,
&
codepage
)))
return
HRESULT_FROM_WIN32
(
err
);
len
=
MultiByteToWideChar
(
codepage
,
0
,
request
->
buffer
,
request
->
ptr
-
request
->
buffer
,
NULL
,
0
);
len
=
MultiByteToWideChar
(
codepage
,
0
,
request
->
buffer
,
request
->
offset
,
NULL
,
0
);
if
(
!
(
*
body
=
SysAllocStringLen
(
NULL
,
len
)))
return
E_OUTOFMEMORY
;
MultiByteToWideChar
(
codepage
,
0
,
request
->
buffer
,
request
->
ptr
-
request
->
buffer
,
*
body
,
len
);
MultiByteToWideChar
(
codepage
,
0
,
request
->
buffer
,
request
->
offset
,
*
body
,
len
);
(
*
body
)[
len
]
=
0
;
return
S_OK
;
}
...
...
@@ -2788,7 +2788,7 @@ static HRESULT WINAPI winhttp_request_Abort(
request
->
wait
=
NULL
;
request
->
cancel
=
NULL
;
request
->
buffer
=
NULL
;
request
->
ptr
=
NULL
;
request
->
offset
=
0
;
request
->
bytes_available
=
0
;
request
->
bytes_read
=
0
;
return
S_OK
;
...
...
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