OLD | NEW |
1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 WinHttpOpen(base::UTF8ToUTF16(PACKAGE_NAME "/" PACKAGE_VERSION).c_str(), | 90 WinHttpOpen(base::UTF8ToUTF16(PACKAGE_NAME "/" PACKAGE_VERSION).c_str(), |
91 WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, | 91 WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, |
92 WINHTTP_NO_PROXY_NAME, | 92 WINHTTP_NO_PROXY_NAME, |
93 WINHTTP_NO_PROXY_BYPASS, | 93 WINHTTP_NO_PROXY_BYPASS, |
94 0)); | 94 0)); |
95 if (!session.get()) { | 95 if (!session.get()) { |
96 LogErrorWinHttpMessage("WinHttpOpen"); | 96 LogErrorWinHttpMessage("WinHttpOpen"); |
97 return false; | 97 return false; |
98 } | 98 } |
99 | 99 |
| 100 int timeout_in_ms = static_cast<int>(timeout() * 1000); |
| 101 if (!WinHttpSetTimeouts(session.get(), |
| 102 timeout_in_ms, |
| 103 timeout_in_ms, |
| 104 timeout_in_ms, |
| 105 timeout_in_ms)) { |
| 106 LogErrorWinHttpMessage("WinHttpSetTimeouts"); |
| 107 return false; |
| 108 } |
| 109 |
100 URL_COMPONENTS url_components = {0}; | 110 URL_COMPONENTS url_components = {0}; |
101 url_components.dwStructSize = sizeof(URL_COMPONENTS); | 111 url_components.dwStructSize = sizeof(URL_COMPONENTS); |
102 url_components.dwHostNameLength = 1; | 112 url_components.dwHostNameLength = 1; |
103 url_components.dwUrlPathLength = 1; | 113 url_components.dwUrlPathLength = 1; |
104 url_components.dwExtraInfoLength = 1; | 114 url_components.dwExtraInfoLength = 1; |
105 std::wstring url_wide(base::UTF8ToUTF16(url())); | 115 std::wstring url_wide(base::UTF8ToUTF16(url())); |
106 if (!WinHttpCrackUrl( | 116 if (!WinHttpCrackUrl( |
107 url_wide.c_str(), 0, ICU_REJECT_USERPWD, &url_components)) { | 117 url_wide.c_str(), 0, ICU_REJECT_USERPWD, &url_components)) { |
108 LogErrorWinHttpMessage("WinHttpCrackUrl"); | 118 LogErrorWinHttpMessage("WinHttpCrackUrl"); |
109 return false; | 119 return false; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 233 } |
224 | 234 |
225 } // namespace | 235 } // namespace |
226 | 236 |
227 // static | 237 // static |
228 scoped_ptr<HTTPTransport> HTTPTransport::Create() { | 238 scoped_ptr<HTTPTransport> HTTPTransport::Create() { |
229 return scoped_ptr<HTTPTransportWin>(new HTTPTransportWin); | 239 return scoped_ptr<HTTPTransportWin>(new HTTPTransportWin); |
230 } | 240 } |
231 | 241 |
232 } // namespace crashpad | 242 } // namespace crashpad |
OLD | NEW |