OLD | NEW |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 set -e | 7 set -e |
8 | 8 |
9 # Product ID in crash report | 9 # Product ID in crash report |
10 CHROMEOS_PRODUCT=ChromeOS | 10 CHROMEOS_PRODUCT=ChromeOS |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 # hours. | 61 # hours. |
62 TIMESTAMPS_DIR="/var/lib/crash_sender" | 62 TIMESTAMPS_DIR="/var/lib/crash_sender" |
63 | 63 |
64 # Path to a directory of restricted certificates which includes | 64 # Path to a directory of restricted certificates which includes |
65 # a certificate for ${REPORT_UPLOAD_PROD_URL}. | 65 # a certificate for ${REPORT_UPLOAD_PROD_URL}. |
66 RESTRICTED_CERTIFICATES_PATH="/usr/share/chromeos-ca-certificates" | 66 RESTRICTED_CERTIFICATES_PATH="/usr/share/chromeos-ca-certificates" |
67 | 67 |
68 # Temp directory for this process. | 68 # Temp directory for this process. |
69 TMP_DIR="" | 69 TMP_DIR="" |
70 | 70 |
71 # Path to get_proxies. | |
72 GET_PROXIES="/usr/bin/get_proxies" | |
73 | |
71 lecho() { | 74 lecho() { |
72 logger -t "${TAG}" "$@" | 75 logger -t "${TAG}" "$@" |
73 } | 76 } |
74 | 77 |
75 # Returns true if mock is enabled. | 78 # Returns true if mock is enabled. |
76 is_mock() { | 79 is_mock() { |
77 [ -f "${MOCK_CRASH_SENDING}" ] && return 0 | 80 [ -f "${MOCK_CRASH_SENDING}" ] && return 0 |
78 return 1 | 81 return 1 |
79 } | 82 } |
80 | 83 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 lecho "Mocking unsuccessful send" | 254 lecho "Mocking unsuccessful send" |
252 return 1 | 255 return 1 |
253 fi | 256 fi |
254 fi | 257 fi |
255 | 258 |
256 if ! sleep ${sleep_time}; then | 259 if ! sleep ${sleep_time}; then |
257 lecho "Sleep failed" | 260 lecho "Sleep failed" |
258 return 1 | 261 return 1 |
259 fi | 262 fi |
260 | 263 |
264 # read in the first proxy, if any, for a given URL. | |
265 local proxy=`${GET_PROXIES} -quiet "${url}" | head -1` | |
266 # if a direct connection should be used, unset the proxy variable. | |
267 [ "${proxy}" = "direct://" ] && proxy= | |
261 local report_id="${TMP_DIR}/report_id" | 268 local report_id="${TMP_DIR}/report_id" |
262 local curl_stderr="${TMP_DIR}/curl_stderr" | 269 local curl_stderr="${TMP_DIR}/curl_stderr" |
263 | 270 |
264 set +e | 271 set +e |
265 curl "${url}" \ | 272 curl "${url}" ${proxy:+--proxy "$proxy"} \ |
kmixter1
2011/04/12 00:35:40
I'm assuming you've checked that "$proxy" ends up
Michael Krebs
2011/04/12 23:00:59
Yeah, that works correctly. However, I just tried
| |
266 --capath "${RESTRICTED_CERTIFICATES_PATH}" --ciphers HIGH \ | 273 --capath "${RESTRICTED_CERTIFICATES_PATH}" --ciphers HIGH \ |
267 -F "prod=${CHROMEOS_PRODUCT}" \ | 274 -F "prod=${CHROMEOS_PRODUCT}" \ |
268 -F "ver=${chromeos_version}" \ | 275 -F "ver=${chromeos_version}" \ |
269 -F "upload_file_${kind}=@${report_payload}" \ | 276 -F "upload_file_${kind}=@${report_payload}" \ |
270 -F "board=${board}" \ | 277 -F "board=${board}" \ |
271 -F "hwclass=${hwclass}" \ | 278 -F "hwclass=${hwclass}" \ |
272 -F "exec_name=${exec_name}" \ | 279 -F "exec_name=${exec_name}" \ |
273 -F "${extra_key1}=${extra_value1}" \ | 280 -F "${extra_key1}=${extra_value1}" \ |
274 -F "${extra_key2}=${extra_value2}" \ | 281 -F "${extra_key2}=${extra_value2}" \ |
275 -F "guid=<${CONSENT_ID}" -o "${report_id}" 2>"${curl_stderr}" | 282 -F "guid=<${CONSENT_ID}" -o "${report_id}" 2>"${curl_stderr}" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
403 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)" | 410 TMP_DIR="$(mktemp -d /tmp/crash_sender.XXXX)" |
404 | 411 |
405 # Send system-wide crashes | 412 # Send system-wide crashes |
406 send_crashes "/var/spool/crash" | 413 send_crashes "/var/spool/crash" |
407 | 414 |
408 # Send user-specific crashes | 415 # Send user-specific crashes |
409 send_crashes "/home/chronos/user/crash" | 416 send_crashes "/home/chronos/user/crash" |
410 } | 417 } |
411 | 418 |
412 main | 419 main |
OLD | NEW |