aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-04-16 21:43:01 +0200
committersteckbrief <steckbrief@chefmail.de>2016-04-16 21:43:01 +0200
commit2fdd4e6518e16949ce483b15471714b10e9cb92e (patch)
treecfa106d5a34982b11249c58ca3ffbae02211c641 /src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
parent36f3bed2eccb3dfd5266304c482497eff0d25c7c (diff)
parentc854f659dbf03ac92f3cb5539b4b424a993acfac (diff)
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to 'src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java')
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
index e236cdc0..94347985 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java
@@ -97,6 +97,7 @@ public class HttpUploadConnection implements Transferable {
public void init(Message message, boolean delay) {
this.message = message;
+ this.message.setHttpUploaded(true);
this.account = message.getConversation().getAccount();
this.file = FileBackend.getFile(message, false);
this.mime = this.file.getMimeType();
@@ -220,8 +221,12 @@ public class HttpUploadConnection implements Transferable {
fail();
}
} catch (IOException e) {
- errorStream = connection.getErrorStream();
- Logging.e("httpupload", "http response: " + new Scanner(errorStream).useDelimiter("\\A").next() + ", exception message: " + e.getMessage());
+ errorStream = (null != connection) ? connection.getErrorStream() : null;
+ String httpResponseMessage = null;
+ if (null != errorStream) {
+ httpResponseMessage = new Scanner(errorStream).useDelimiter("\\A").next();
+ }
+ Logging.e("httpupload", ((null != httpResponseMessage) ? ("http response: " + httpResponseMessage + ", ") : "") + "exception message: " + e.getMessage());
fail();
} finally {
StreamUtil.close(os);