jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java Fri Feb 10 00:39:51 2017 -0800
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -512,9 +512,13 @@
: httpConnection.getInputStream());
// If no reply message is returned,
// content-Length header field value is expected to be zero.
- // InputStream#available() can't be used here - it just says no data *YET*!
+ // java SE 6 documentation says :
+ // available() : an estimate of the number of bytes that can be read
+ //(or skipped over) from this input stream without blocking
+ //or 0 when it reaches the end of the input stream.
if ((httpIn == null )
- || (httpConnection.getContentLength() == 0)) {
+ || (httpConnection.getContentLength() == 0)
+ || (httpIn.available() == 0)) {
response = null;
log.warning("SAAJ0014.p2p.content.zero");
} else {