| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "bin/secure_socket.h" | 5 #include "bin/secure_socket.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 static void ThrowIOException(int status, | 74 static void ThrowIOException(int status, |
| 75 const char* exception_type, | 75 const char* exception_type, |
| 76 const char* message, | 76 const char* message, |
| 77 bool free_message = false) { | 77 bool free_message = false) { |
| 78 char error_string[SSL_ERROR_MESSAGE_BUFFER_SIZE]; | 78 char error_string[SSL_ERROR_MESSAGE_BUFFER_SIZE]; |
| 79 FetchErrorString(error_string, SSL_ERROR_MESSAGE_BUFFER_SIZE); | 79 FetchErrorString(error_string, SSL_ERROR_MESSAGE_BUFFER_SIZE); |
| 80 OSError os_error_struct(status, error_string, OSError::kBoringSSL); | 80 OSError os_error_struct(status, error_string, OSError::kBoringSSL); |
| 81 Dart_Handle os_error = DartUtils::NewDartOSError(&os_error_struct); | 81 Dart_Handle os_error = DartUtils::NewDartOSError(&os_error_struct); |
| 82 Dart_Handle exception = | 82 Dart_Handle exception = |
| 83 DartUtils::NewDartIOException(exception_type, message, os_error); | 83 DartUtils::NewDartIOException(exception_type, message, os_error); |
| 84 ASSERT(!Dart_IsError(exception)); |
| 84 if (free_message) { | 85 if (free_message) { |
| 85 free(const_cast<char*>(message)); | 86 free(const_cast<char*>(message)); |
| 86 } | 87 } |
| 87 Dart_ThrowException(exception); | 88 Dart_ThrowException(exception); |
| 88 UNREACHABLE(); | 89 UNREACHABLE(); |
| 89 } | 90 } |
| 90 | 91 |
| 91 | 92 |
| 92 static SSLFilter* GetFilter(Dart_NativeArguments args) { | 93 static SSLFilter* GetFilter(Dart_NativeArguments args) { |
| 93 SSLFilter* filter; | 94 SSLFilter* filter; |
| (...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 } else { | 1121 } else { |
| 1121 if (SSL_LOG_DATA) Log::Print( | 1122 if (SSL_LOG_DATA) Log::Print( |
| 1122 "WriteEncrypted BIO_read wrote %d bytes\n", bytes_processed); | 1123 "WriteEncrypted BIO_read wrote %d bytes\n", bytes_processed); |
| 1123 } | 1124 } |
| 1124 } | 1125 } |
| 1125 return bytes_processed; | 1126 return bytes_processed; |
| 1126 } | 1127 } |
| 1127 | 1128 |
| 1128 } // namespace bin | 1129 } // namespace bin |
| 1129 } // namespace dart | 1130 } // namespace dart |
| OLD | NEW |