Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/socket/tcp_node.cc

Issue 458563002: [NaCl SDK] Fix bug in TCPNode::Connect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | native_client_sdk/src/tests/nacl_io_socket_test/socket_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "nacl_io/ossocket.h" 5 #include "nacl_io/ossocket.h"
6 #ifdef PROVIDES_SOCKET_API 6 #ifdef PROVIDES_SOCKET_API
7 7
8 #include <assert.h> 8 #include <assert.h>
9 #include <errno.h> 9 #include <errno.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 Error err = wait.WaitOnEvent(POLLOUT, ms); 473 Error err = wait.WaitOnEvent(POLLOUT, ms);
474 if (ETIMEDOUT == err) 474 if (ETIMEDOUT == err)
475 return EINPROGRESS; 475 return EINPROGRESS;
476 476
477 // If we fail, release the dest addr resource 477 // If we fail, release the dest addr resource
478 if (err != 0) { 478 if (err != 0) {
479 ConnectFailed_Locked(); 479 ConnectFailed_Locked();
480 return err; 480 return err;
481 } 481 }
482 482
483 // Make sure the connection succeeded.
484 if (last_errno_ != 0) {
485 ConnectFailed_Locked();
486 return last_errno_;
487 }
488
483 ConnectDone_Locked(); 489 ConnectDone_Locked();
484 return 0; 490 return 0;
485 } 491 }
486 492
487 Error TcpNode::Shutdown(int how) { 493 Error TcpNode::Shutdown(int how) {
488 AUTO_LOCK(node_lock_); 494 AUTO_LOCK(node_lock_);
489 if (!IsConnected()) 495 if (!IsConnected())
490 return ENOTCONN; 496 return ENOTCONN;
491 497
492 { 498 {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 assert(emitter_.get()); 562 assert(emitter_.get());
557 if (emitter_->GetError_Locked()) 563 if (emitter_->GetError_Locked())
558 return EPIPE; 564 return EPIPE;
559 *out_len = emitter_->WriteOut_Locked((char*)buf, len); 565 *out_len = emitter_->WriteOut_Locked((char*)buf, len);
560 return 0; 566 return 0;
561 } 567 }
562 568
563 } // namespace nacl_io 569 } // namespace nacl_io
564 570
565 #endif // PROVIDES_SOCKET_API 571 #endif // PROVIDES_SOCKET_API
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/tests/nacl_io_socket_test/socket_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698