Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginWbPassThrough.cpp

Issue 11167069: Fix the crash. IInternetBindInfo BINDSTRING_XDR_ORIGIN bug workaround. (Closed)
Patch Set: Created July 24, 2013, 8:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginWbPassThrough.h" 3 #include "PluginWbPassThrough.h"
4 #include "PluginClient.h" 4 #include "PluginClient.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #ifdef SUPPORT_FILTER 6 #ifdef SUPPORT_FILTER
7 #include "PluginFilter.h" 7 #include "PluginFilter.h"
8 #endif 8 #endif
9 #include "PluginSettings.h" 9 #include "PluginSettings.h"
10 #include "PluginClass.h" 10 #include "PluginClass.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 DEBUG_GENERAL(src); 130 DEBUG_GENERAL(src);
131 CPluginClient::UnescapeUrl(src); 131 CPluginClient::UnescapeUrl(src);
132 m_url = szUrl; 132 m_url = szUrl;
133 133
134 CString boundDomain; 134 CString boundDomain;
135 CString mimeType; 135 CString mimeType;
136 if (pOIBindInfo) 136 if (pOIBindInfo)
137 { 137 {
138 ULONG resLen = 0; 138 ULONG resLen = 0;
139 LPOLESTR mime = 0; 139 LPOLESTR mime = 0;
140 HRESULT hr = pOIBindInfo->GetBindString(BINDSTRING_ACCEPT_MIMES, &mime, 1, & resLen); 140 HRESULT hr = pOIBindInfo->GetBindString(BINDSTRING_ACCEPT_MIMES, &mime, 1, & resLen);
Felix Dahlke 2013/08/08 14:13:55 Just noticed that hr is unused here, we shouldn't
Felix Dahlke 2013/08/09 07:12:33 You haven't addressed this comment.
141 if (mime && resLen > 0) 141 if (mime && resLen > 0)
142 { 142 {
143 mimeType.SetString(mime); 143 mimeType.SetString(mime);
144 } 144 }
145 LPOLESTR bindToObject = 0;
146 hr = pOIBindInfo->GetBindString(BINDSTRING_FLAG_BIND_TO_OBJECT, &bindToObjec t, 1, &resLen);
145 LPOLESTR domainRetrieved = 0; 147 LPOLESTR domainRetrieved = 0;
146 hr = pOIBindInfo->GetBindString(BINDSTRING_XDR_ORIGIN, &domainRetrieved, 1, &resLen); 148 if (resLen == 0 || wcscmp(bindToObject, L"FALSE") == 0)
149 {
150 hr = pOIBindInfo->GetBindString(BINDSTRING_XDR_ORIGIN, &domainRetrieved, 1 , &resLen);
151 }
147 if ((hr == S_OK) && domainRetrieved && (resLen > 0)) 152 if ((hr == S_OK) && domainRetrieved && (resLen > 0))
Felix Dahlke 2013/08/05 14:28:05 Shouldn't this be moved into the if as well? What
Oleksandr 2013/08/08 14:03:20 I might be missing something but we will not do an
Felix Dahlke 2013/08/08 14:13:55 Right, there's a check for domainRetrieved there,
Oleksandr 2013/08/08 14:22:21 Agreed. On 2013/08/08 14:13:55, Felix H. Dahlke w
148 { 153 {
149 boundDomain.SetString(domainRetrieved); 154 boundDomain.SetString(domainRetrieved);
150 // Remove protocol 155 // Remove protocol
151 int pos = boundDomain.Find(L"://"); 156 int pos = boundDomain.Find(L"://");
152 if (pos > 0) 157 if (pos > 0)
153 { 158 {
154 boundDomain = boundDomain.Mid(pos + 3); 159 boundDomain = boundDomain.Mid(pos + 3);
155 } 160 }
156 // Remove port 161 // Remove port
157 pos = boundDomain.Find(L":"); 162 pos = boundDomain.Find(L":");
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 CComPtr<IHttpNegotiate> spHttpNegotiate; 367 CComPtr<IHttpNegotiate> spHttpNegotiate;
363 QueryServiceFromClient(&spHttpNegotiate); 368 QueryServiceFromClient(&spHttpNegotiate);
364 369
365 return spHttpNegotiate ? spHttpNegotiate->OnResponse(dwResponseCode, szRespons eHeaders, szRequestHeaders, pszAdditionalRequestHeaders) : S_OK; 370 return spHttpNegotiate ? spHttpNegotiate->OnResponse(dwResponseCode, szRespons eHeaders, szRequestHeaders, pszAdditionalRequestHeaders) : S_OK;
366 } 371 }
367 372
368 STDMETHODIMP WBPassthruSink::ReportProgress(ULONG ulStatusCode, LPCWSTR szStatus Text) 373 STDMETHODIMP WBPassthruSink::ReportProgress(ULONG ulStatusCode, LPCWSTR szStatus Text)
369 { 374 {
370 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgress(ulS tatusCode, szStatusText) : S_OK; 375 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgress(ulS tatusCode, szStatusText) : S_OK;
371 } 376 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld