OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include "native_client/src/trusted/service_runtime/nacl_secure_service.h" | 7 #include "native_client/src/trusted/service_runtime/nacl_secure_service.h" |
8 | 8 |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 static void NaClSecureServiceLogRpc( | 250 static void NaClSecureServiceLogRpc( |
251 struct NaClSrpcRpc *rpc, | 251 struct NaClSrpcRpc *rpc, |
252 struct NaClSrpcArg **in_args, | 252 struct NaClSrpcArg **in_args, |
253 struct NaClSrpcArg **out_args, | 253 struct NaClSrpcArg **out_args, |
254 struct NaClSrpcClosure *done_cls) { | 254 struct NaClSrpcClosure *done_cls) { |
255 int severity = in_args[0]->u.ival; | 255 int severity = in_args[0]->u.ival; |
256 char *msg = in_args[1]->arrays.str; | 256 char *msg = in_args[1]->arrays.str; |
257 UNREFERENCED_PARAMETER(out_args); | 257 UNREFERENCED_PARAMETER(out_args); |
258 | 258 |
259 NaClLog(5, "NaClSecureChannelLogRpc\n"); | 259 NaClLog(5, "NaClSecureChannelLogRpc\n"); |
| 260 if (LOG_FATAL == severity) { |
| 261 /* |
| 262 * Do not actually abort due to LOG_FATAL. SRPC is deprecated and the |
| 263 * only remaining user of this Log RPC corresponds to fairly benign |
| 264 * errors. Also, at this point the backtraces will not be terribly |
| 265 * interesting. Therefore, avoid spamming the crash report counter |
| 266 * for such errors and exit cleanly. Run the abort hook as well, |
| 267 * to flush the logs. |
| 268 */ |
| 269 NaClLog(LOG_ERROR, "%s\n", msg); |
| 270 NaClLogRunAbortBehavior(); |
| 271 NaClExit(1); |
| 272 } |
260 NaClLog(severity, "%s\n", msg); | 273 NaClLog(severity, "%s\n", msg); |
261 NaClLog(5, "NaClSecureChannelLogRpc\n"); | 274 NaClLog(5, "NaClSecureChannelLogRpc\n"); |
262 rpc->result = NACL_SRPC_RESULT_OK; | 275 rpc->result = NACL_SRPC_RESULT_OK; |
263 (*done_cls->Run)(done_cls); | 276 (*done_cls->Run)(done_cls); |
264 } | 277 } |
265 | 278 |
266 static void NaClSecureServiceShutdownRpc( | 279 static void NaClSecureServiceShutdownRpc( |
267 struct NaClSrpcRpc *rpc, | 280 struct NaClSrpcRpc *rpc, |
268 struct NaClSrpcArg **in_args, | 281 struct NaClSrpcArg **in_args, |
269 struct NaClSrpcArg **out_args, | 282 struct NaClSrpcArg **out_args, |
(...skipping 18 matching lines...) Expand all Loading... |
288 | 301 |
289 struct NaClSimpleServiceVtbl const kNaClSecureServiceVtbl = { | 302 struct NaClSimpleServiceVtbl const kNaClSecureServiceVtbl = { |
290 { | 303 { |
291 NaClSecureServiceDtor, | 304 NaClSecureServiceDtor, |
292 }, | 305 }, |
293 NaClSecureServiceConnectionFactory, | 306 NaClSecureServiceConnectionFactory, |
294 NaClSecureServiceAcceptConnection, | 307 NaClSecureServiceAcceptConnection, |
295 NaClSimpleServiceAcceptAndSpawnHandler, | 308 NaClSimpleServiceAcceptAndSpawnHandler, |
296 NaClSecureServiceRpcHandler, | 309 NaClSecureServiceRpcHandler, |
297 }; | 310 }; |
OLD | NEW |