OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2008 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 /* | 7 /* |
8 * Service descriptions. | 8 * Service descriptions. |
9 */ | 9 */ |
10 | 10 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 static void ServiceDiscovery(NaClSrpcRpc* rpc, | 427 static void ServiceDiscovery(NaClSrpcRpc* rpc, |
428 NaClSrpcArg** in_args, | 428 NaClSrpcArg** in_args, |
429 NaClSrpcArg** out_args, | 429 NaClSrpcArg** out_args, |
430 NaClSrpcClosure* done) { | 430 NaClSrpcClosure* done) { |
431 UNREFERENCED_PARAMETER(in_args); | 431 UNREFERENCED_PARAMETER(in_args); |
432 rpc->result = NACL_SRPC_RESULT_APP_ERROR; | 432 rpc->result = NACL_SRPC_RESULT_APP_ERROR; |
433 if (NULL == rpc->channel || NULL == rpc->channel->server) { | 433 if (NULL == rpc->channel || NULL == rpc->channel->server) { |
434 done->Run(done); | 434 done->Run(done); |
435 return; | 435 return; |
436 } | 436 } |
437 if (out_args[0]->u.caval.count >= | 437 if (out_args[0]->u.count >= rpc->channel->server->service_string_length) { |
438 rpc->channel->server->service_string_length) { | 438 strncpy(out_args[0]->arrays.carr, |
439 strncpy(out_args[0]->u.caval.carr, | |
440 rpc->channel->server->service_string, | 439 rpc->channel->server->service_string, |
441 rpc->channel->server->service_string_length); | 440 rpc->channel->server->service_string_length); |
442 /* Set the length of the string actually returned. */ | 441 /* Set the length of the string actually returned. */ |
443 out_args[0]->u.caval.count = rpc->channel->server->service_string_length; | 442 out_args[0]->u.count = rpc->channel->server->service_string_length; |
444 rpc->result = NACL_SRPC_RESULT_OK; | 443 rpc->result = NACL_SRPC_RESULT_OK; |
445 } | 444 } |
446 done->Run(done); | 445 done->Run(done); |
447 } | 446 } |
OLD | NEW |