aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Vartanian <flooey@google.com>2018-02-23 15:51:57 +0000
committerAdam Vartanian <flooey@google.com>2018-02-23 15:52:03 +0000
commitf753e05a9ea99c2f8aaf7e12cec1a00cbb5ee991 (patch)
treeb106fecbe77c642cce74a26771ddfc48f1121370
parent1b7ad09993c8e5f78617bca4c3320faa7d1bc602 (diff)
parentd84f6f57b216ab53dc3a71d30fd2252ce2208c13 (diff)
downloadconscrypt-f753e05a9ea99c2f8aaf7e12cec1a00cbb5ee991.tar.gz
Merge upstream master
Only change from upstream is throwing a new exception in one case. Bug: 73596939 Test: cts -m CtsLibcoreTestCases -t com.android.org.conscrypt.javax.net.ssl Change-Id: I36f2cd5682b13793fce480e08618ffe2bba4a48e
-rw-r--r--common/src/jni/main/cpp/conscrypt/native_crypto.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/src/jni/main/cpp/conscrypt/native_crypto.cc b/common/src/jni/main/cpp/conscrypt/native_crypto.cc
index 053315e1..d2955403 100644
--- a/common/src/jni/main/cpp/conscrypt/native_crypto.cc
+++ b/common/src/jni/main/cpp/conscrypt/native_crypto.cc
@@ -7886,10 +7886,12 @@ static int sslRead(JNIEnv* env, SSL* ssl, jobject fdObject, jobject shc, char* b
// A problem occurred during a system call, but this is not
// necessarily an error.
case SSL_ERROR_SYSCALL: {
- // Connection closed without proper shutdown. Tell caller we
- // have reached end-of-stream.
+ // Connection closed without proper shutdown. Throw a SocketException to
+ // indicate that the socket is closed.
if (result == 0) {
- return -1;
+ conscrypt::jniutil::throwException(env, "java/net/SocketException",
+ "Socket closed");
+ return THROWN_EXCEPTION;
}
// System call has been interrupted. Simply retry.