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
c2ffe977
Commit
c2ffe977
authored
Mar 02, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Move HttpProtocol::Continue implementation to generic Protocol object.
parent
4c129514
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
0 deletions
+70
-0
http.c
dlls/urlmon/http.c
+0
-0
protocol.c
dlls/urlmon/protocol.c
+68
-0
urlmon_main.h
dlls/urlmon/urlmon_main.h
+2
-0
No files found.
dlls/urlmon/http.c
View file @
c2ffe977
This diff is collapsed.
Click to expand it.
dlls/urlmon/protocol.c
View file @
c2ffe977
...
...
@@ -53,6 +53,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
#define FLAG_LAST_DATA_REPORTED 0x0010
#define FLAG_RESULT_REPORTED 0x0020
static
inline
HRESULT
report_progress
(
Protocol
*
protocol
,
ULONG
status_code
,
LPCWSTR
status_text
)
{
return
IInternetProtocolSink_ReportProgress
(
protocol
->
protocol_sink
,
status_code
,
status_text
);
}
static
inline
HRESULT
report_result
(
Protocol
*
protocol
,
HRESULT
hres
)
{
if
(
!
(
protocol
->
flags
&
FLAG_RESULT_REPORTED
)
&&
protocol
->
protocol_sink
)
{
...
...
@@ -95,6 +100,69 @@ static void all_data_read(Protocol *protocol)
report_result
(
protocol
,
S_OK
);
}
HRESULT
protocol_continue
(
Protocol
*
protocol
,
PROTOCOLDATA
*
data
)
{
HRESULT
hres
;
if
(
!
data
)
{
WARN
(
"Expected pProtocolData to be non-NULL
\n
"
);
return
S_OK
;
}
if
(
!
protocol
->
request
)
{
WARN
(
"Expected request to be non-NULL
\n
"
);
return
S_OK
;
}
if
(
!
protocol
->
protocol_sink
)
{
WARN
(
"Expected IInternetProtocolSink pointer to be non-NULL
\n
"
);
return
S_OK
;
}
if
(
data
->
pData
==
(
LPVOID
)
BINDSTATUS_DOWNLOADINGDATA
)
{
hres
=
protocol
->
vtbl
->
start_downloading
(
protocol
);
if
(
FAILED
(
hres
))
{
protocol_close_connection
(
protocol
);
report_result
(
protocol
,
hres
);
return
S_OK
;
}
if
(
protocol
->
bindf
&
BINDF_NEEDFILE
)
{
WCHAR
cache_file
[
MAX_PATH
];
DWORD
buflen
=
sizeof
(
cache_file
);
if
(
InternetQueryOptionW
(
protocol
->
request
,
INTERNET_OPTION_DATAFILE_NAME
,
cache_file
,
&
buflen
))
{
report_progress
(
protocol
,
BINDSTATUS_CACHEFILENAMEAVAILABLE
,
cache_file
);
}
else
{
FIXME
(
"Could not get cache file
\n
"
);
}
}
protocol
->
flags
|=
FLAG_FIRST_CONTINUE_COMPLETE
;
}
if
(
data
->
pData
>=
(
LPVOID
)
BINDSTATUS_DOWNLOADINGDATA
)
{
BOOL
res
;
/* InternetQueryDataAvailable may immediately fork and perform its asynchronous
* read, so clear the flag _before_ calling so it does not incorrectly get cleared
* after the status callback is called */
protocol
->
flags
&=
~
FLAG_REQUEST_COMPLETE
;
res
=
InternetQueryDataAvailable
(
protocol
->
request
,
&
protocol
->
available_bytes
,
0
,
0
);
if
(
res
)
{
protocol
->
flags
|=
FLAG_REQUEST_COMPLETE
;
report_data
(
protocol
);
}
else
if
(
GetLastError
()
!=
ERROR_IO_PENDING
)
{
protocol
->
flags
|=
FLAG_REQUEST_COMPLETE
;
WARN
(
"InternetQueryDataAvailable failed: %d
\n
"
,
GetLastError
());
report_result
(
protocol
,
INET_E_DATA_NOT_AVAILABLE
);
}
}
return
S_OK
;
}
HRESULT
protocol_read
(
Protocol
*
protocol
,
void
*
buf
,
ULONG
size
,
ULONG
*
read_ret
)
{
ULONG
read
=
0
;
...
...
dlls/urlmon/urlmon_main.h
View file @
c2ffe977
...
...
@@ -103,9 +103,11 @@ typedef struct {
}
Protocol
;
struct
ProtocolVtbl
{
HRESULT
(
*
start_downloading
)(
Protocol
*
);
void
(
*
close_connection
)(
Protocol
*
);
};
HRESULT
protocol_continue
(
Protocol
*
,
PROTOCOLDATA
*
);
HRESULT
protocol_read
(
Protocol
*
,
void
*
,
ULONG
,
ULONG
*
);
HRESULT
protocol_lock_request
(
Protocol
*
);
HRESULT
protocol_unlock_request
(
Protocol
*
);
...
...
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