Merge "Allow getResponseCode to block if response hasn't been received from remote" am: 834e5ce170
am: b987832918
Change-Id: Ie688a54c9774b269b90cd96aecfc7ef6a621bf86
This commit is contained in:
@@ -207,7 +207,6 @@ public final class ClientOperation implements Operation, BaseStream {
|
|||||||
* object
|
* object
|
||||||
*/
|
*/
|
||||||
public synchronized int getResponseCode() throws IOException {
|
public synchronized int getResponseCode() throws IOException {
|
||||||
//avoid dup validateConnection
|
|
||||||
if ((mReplyHeader.responseCode == -1)
|
if ((mReplyHeader.responseCode == -1)
|
||||||
|| (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE)) {
|
|| (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE)) {
|
||||||
validateConnection();
|
validateConnection();
|
||||||
@@ -423,8 +422,9 @@ public final class ClientOperation implements Operation, BaseStream {
|
|||||||
private void validateConnection() throws IOException {
|
private void validateConnection() throws IOException {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
|
|
||||||
// to sure only one privateInput object exist.
|
// Make sure that a response has been recieved from remote
|
||||||
if (mPrivateInput == null) {
|
// before continuing
|
||||||
|
if (mPrivateInput == null || mReplyHeader.responseCode == -1) {
|
||||||
startProcessing();
|
startProcessing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user