mshtml: Try using IWinInetHttpInfo if OnResponse was not called.
This commit is contained in:
parent
05dc7eac8d
commit
a982933869
|
@ -87,6 +87,7 @@ struct nsChannelBSC {
|
||||||
nsISupports *nscontext;
|
nsISupports *nscontext;
|
||||||
BOOL is_js;
|
BOOL is_js;
|
||||||
BOOL is_doc_channel;
|
BOOL is_doc_channel;
|
||||||
|
BOOL response_processed;
|
||||||
|
|
||||||
nsProtocolStream *nsstream;
|
nsProtocolStream *nsstream;
|
||||||
};
|
};
|
||||||
|
|
|
@ -754,6 +754,33 @@ static HRESULT process_response_headers(nsChannelBSC *This, const WCHAR *headers
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void query_http_info(nsChannelBSC *This, IWinInetHttpInfo *wininet_info)
|
||||||
|
{
|
||||||
|
const WCHAR *ptr;
|
||||||
|
DWORD len = 0;
|
||||||
|
WCHAR *buf;
|
||||||
|
|
||||||
|
IWinInetHttpInfo_QueryInfo(wininet_info, HTTP_QUERY_RAW_HEADERS_CRLF, NULL, &len, NULL, NULL);
|
||||||
|
if(!len)
|
||||||
|
return;
|
||||||
|
|
||||||
|
buf = heap_alloc(len);
|
||||||
|
if(!buf)
|
||||||
|
return;
|
||||||
|
|
||||||
|
IWinInetHttpInfo_QueryInfo(wininet_info, HTTP_QUERY_RAW_HEADERS_CRLF, buf, &len, NULL, NULL);
|
||||||
|
if(!len)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ptr = strchrW(buf, '\r');
|
||||||
|
if(ptr && ptr[1] == '\n') {
|
||||||
|
ptr += 2;
|
||||||
|
process_response_headers(This, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
heap_free(buf);
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT start_binding(HTMLInnerWindow *inner_window, BSCallback *bscallback, IBindCtx *bctx)
|
HRESULT start_binding(HTMLInnerWindow *inner_window, BSCallback *bscallback, IBindCtx *bctx)
|
||||||
{
|
{
|
||||||
IStream *str = NULL;
|
IStream *str = NULL;
|
||||||
|
@ -1111,6 +1138,19 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
if(!This->response_processed) {
|
||||||
|
IWinInetHttpInfo *wininet_info;
|
||||||
|
|
||||||
|
This->response_processed = TRUE;
|
||||||
|
if(This->bsc.binding) {
|
||||||
|
hres = IBinding_QueryInterface(This->bsc.binding, &IID_IWinInetHttpInfo, (void**)&wininet_info);
|
||||||
|
if(SUCCEEDED(hres)) {
|
||||||
|
query_http_info(This, wininet_info);
|
||||||
|
IWinInetHttpInfo_Release(wininet_info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!This->nslistener) {
|
if(!This->nslistener) {
|
||||||
BYTE buf[1024];
|
BYTE buf[1024];
|
||||||
|
|
||||||
|
@ -1601,6 +1641,7 @@ static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code,
|
||||||
nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc);
|
nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc);
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
This->response_processed = TRUE;
|
||||||
This->nschannel->response_status = response_code;
|
This->nschannel->response_status = response_code;
|
||||||
|
|
||||||
if(response_headers) {
|
if(response_headers) {
|
||||||
|
|
Loading…
Reference in New Issue