8203937: Not possible to read data from socket after write detects connection reset

Reviewed-by: chegar
This commit is contained in:
Alan Bateman 2018-06-06 12:17:01 +01:00
parent ee5ff58a3d
commit 79ed34634b
3 changed files with 142 additions and 11 deletions

View file

@ -108,13 +108,8 @@ Java_java_net_SocketOutputStream_socketWrite0(JNIEnv *env, jobject this,
loff += n;
continue;
}
if (errno == ECONNRESET) {
JNU_ThrowByName(env, "sun/net/ConnectionResetException",
"Connection reset");
} else {
JNU_ThrowByNameWithMessageAndLastError
(env, "java/net/SocketException", "Write failed");
}
JNU_ThrowByNameWithMessageAndLastError
(env, "java/net/SocketException", "Write failed");
if (bufP != BUF) {
free(bufP);
}