OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 if (!jHeaderValue) | 245 if (!jHeaderValue) |
246 break; | 246 break; |
247 | 247 |
248 std::string headerName = GetString(jniEnv, jHeaderName); | 248 std::string headerName = GetString(jniEnv, jHeaderName); |
249 std::string headerValue = GetString(jniEnv, jHeaderValue); | 249 std::string headerValue = GetString(jniEnv, jHeaderValue); |
250 | 250 |
251 headerName = TrimString(headerName); | 251 headerName = TrimString(headerName); |
252 headerValue = TrimString(headerValue); | 252 headerValue = TrimString(headerValue); |
253 | 253 |
254 std::transform(headerName.begin(), headerName.end(), headerName.begin(), :
:tolower); | 254 std::transform(headerName.begin(), headerName.end(), headerName.begin(), :
:tolower); |
255 std::transform(headerValue.begin(), headerValue.end(), headerValue.begin()
, ::tolower); | |
256 | 255 |
257 result.responseHeaders.push_back(std::pair<std::string, std::string>(heade
rName, headerValue)); | 256 result.responseHeaders.push_back(std::pair<std::string, std::string>(heade
rName, headerValue)); |
258 | 257 |
259 i++; | 258 i++; |
260 } | 259 } |
261 D(D_WARN, "Finished downloading"); | 260 D(D_WARN, "Finished downloading"); |
262 | 261 |
263 result.status = AdblockPlus::DefaultWebRequest::NS_OK; | 262 result.status = AdblockPlus::DefaultWebRequest::NS_OK; |
264 } | 263 } |
265 catch(JavaException& e) | 264 catch(JavaException& e) |
(...skipping 17 matching lines...) Expand all Loading... |
283 { | 282 { |
284 D(D_ERROR, "Unknown exception"); | 283 D(D_ERROR, "Unknown exception"); |
285 result.status = AdblockPlus::DefaultWebRequest::NS_ERROR_FAILURE; | 284 result.status = AdblockPlus::DefaultWebRequest::NS_ERROR_FAILURE; |
286 } | 285 } |
287 | 286 |
288 if (stat == JNI_EDETACHED) | 287 if (stat == JNI_EDETACHED) |
289 globalJvm->DetachCurrentThread(); | 288 globalJvm->DetachCurrentThread(); |
290 | 289 |
291 return result; | 290 return result; |
292 } | 291 } |
OLD | NEW |