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

Side by Side Diff: net/tools/flip_server/flip_in_mem_edsm_server.cc

Issue 6338013: Handle error case on SSL read which was not properly exiting.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <dirent.h> 5 #include <dirent.h>
6 #include <netinet/tcp.h> // For TCP_NODELAY 6 #include <netinet/tcp.h> // For TCP_NODELAY
7 #include <sys/socket.h> 7 #include <sys/socket.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <sys/file.h> 9 #include <sys/file.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 if (bytes_read < 0) { 1118 if (bytes_read < 0) {
1119 switch(SSL_get_error(ssl_, bytes_read)) { 1119 switch(SSL_get_error(ssl_, bytes_read)) {
1120 case SSL_ERROR_WANT_READ: 1120 case SSL_ERROR_WANT_READ:
1121 case SSL_ERROR_WANT_WRITE: 1121 case SSL_ERROR_WANT_WRITE:
1122 case SSL_ERROR_WANT_ACCEPT: 1122 case SSL_ERROR_WANT_ACCEPT:
1123 case SSL_ERROR_WANT_CONNECT: 1123 case SSL_ERROR_WANT_CONNECT:
1124 events_ &= ~EPOLLIN; 1124 events_ &= ~EPOLLIN;
1125 goto done; 1125 goto done;
1126 default: 1126 default:
1127 PrintSslError(); 1127 PrintSslError();
1128 break; 1128 goto error_or_close;
1129 } 1129 }
1130 } 1130 }
1131 } else { 1131 } else {
1132 bytes_read = recv(fd_, bytes, size, MSG_DONTWAIT); 1132 bytes_read = recv(fd_, bytes, size, MSG_DONTWAIT);
1133 } 1133 }
1134 int stored_errno = errno; 1134 int stored_errno = errno;
1135 if (bytes_read == -1) { 1135 if (bytes_read == -1) {
1136 switch (stored_errno) { 1136 switch (stored_errno) {
1137 case EAGAIN: 1137 case EAGAIN:
1138 events_ &= ~EPOLLIN; 1138 events_ &= ~EPOLLIN;
(...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after
3369 } 3369 }
3370 break; 3370 break;
3371 } 3371 }
3372 usleep(1000*10); // 10 ms 3372 usleep(1000*10); // 10 ms
3373 } 3373 }
3374 3374
3375 unlink(PIDFILE); 3375 unlink(PIDFILE);
3376 close(pidfile_fd); 3376 close(pidfile_fd);
3377 return 0; 3377 return 0;
3378 } 3378 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698