jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
changeset 43852 93a527059d8a
parent 36263 d5333008e409
child 45678 65fdff10664d
equal deleted inserted replaced
43752:3c68ef249093 43852:93a527059d8a
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   510                         (isFailure
   510                         (isFailure
   511                         ? httpConnection.getErrorStream()
   511                         ? httpConnection.getErrorStream()
   512                         : httpConnection.getInputStream());
   512                         : httpConnection.getInputStream());
   513                 // If no reply message is returned,
   513                 // If no reply message is returned,
   514                 // content-Length header field value is expected to be zero.
   514                 // content-Length header field value is expected to be zero.
   515                 // InputStream#available() can't be used here - it just says no data *YET*!
   515                 // java SE 6 documentation says :
       
   516                 // available() : an estimate of the number of bytes that can be read
       
   517                 //(or skipped over) from this input stream without blocking
       
   518                 //or 0 when it reaches the end of the input stream.
   516                 if ((httpIn == null )
   519                 if ((httpIn == null )
   517                         || (httpConnection.getContentLength() == 0)) {
   520                         || (httpConnection.getContentLength() == 0)
       
   521                         || (httpIn.available() == 0)) {
   518                     response = null;
   522                     response = null;
   519                     log.warning("SAAJ0014.p2p.content.zero");
   523                     log.warning("SAAJ0014.p2p.content.zero");
   520                 } else {
   524                 } else {
   521                     response = messageFactory.createMessage(headers, httpIn);
   525                     response = messageFactory.createMessage(headers, httpIn);
   522                 }
   526                 }