--- a/src/jdk.httpserver/share/classes/sun/net/httpserver/FixedLengthInputStream.java Mon Nov 06 22:05:53 2017 +0530
+++ b/src/jdk.httpserver/share/classes/sun/net/httpserver/FixedLengthInputStream.java Mon Nov 06 16:32:00 2017 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -60,6 +60,8 @@
t.getServerImpl().requestCompleted (t.getConnection());
}
}
+ if (n < 0 && !eof)
+ throw new IOException("connection closed before all data received");
return n;
}