< prev index next >
src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 510,526 ****
(isFailure
? httpConnection.getErrorStream()
: httpConnection.getInputStream());
// If no reply message is returned,
// content-Length header field value is expected to be zero.
! // 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)
! || (httpIn.available() == 0)) {
response = null;
log.warning("SAAJ0014.p2p.content.zero");
} else {
response = messageFactory.createMessage(headers, httpIn);
}
--- 510,522 ----
(isFailure
? httpConnection.getErrorStream()
: 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*!
if ((httpIn == null )
! || (httpConnection.getContentLength() == 0)) {
response = null;
log.warning("SAAJ0014.p2p.content.zero");
} else {
response = messageFactory.createMessage(headers, httpIn);
}
< prev index next >