Skip to content

Commit f651f63

Browse files
committed
HTTPBase is now closed after action to prevent blocking
1 parent 9ee4528 commit f651f63

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.taliox</groupId>
88
<artifactId>zulip-java-rest</artifactId>
9-
<version>0.0.1-SNAPSHOT</version>
9+
<version>1.0.0-SNAPSHOT</version>
1010
<inceptionYear>2019</inceptionYear>
1111

1212
<parent>

src/main/java/io/taliox/zulip/ZulipRestExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.taliox.zulip;
22

33
import io.taliox.zulip.calls.ZulipRestAPICall;
4+
import io.taliox.zulip.calls.users.GetProfile;
45
import io.taliox.zulip.controller.HttpController;
56

67
/**
@@ -37,5 +38,5 @@ public ZulipRestExecutor(String userName, String password, String serverURL) {
3738
public String executeCall(ZulipRestAPICall call) {
3839
return call.execute(this);
3940
}
40-
41+
4142
}

src/main/java/io/taliox/zulip/calls/ZulipRestAPICall.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ protected String performRequest(HashMap<String, String> parameters, HttpRequestB
138138
"Bad request. The server could not process your request sucessfully: " + builder.toString());
139139
}
140140

141+
base.releaseConnection();
142+
141143
} catch (ClientProtocolException e) {
142144
e.printStackTrace();
143145
} catch (IOException e) {

src/main/java/io/taliox/zulip/calls/users/GetProfile.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public GetProfile() {
2828
* @see io.taliox.zulip.calls.Callable#execute()
2929
*/
3030
public String execute(ZulipRestExecutor executor) {
31-
setHttpController(executor.httpController);
3231
setHttpController(executor.httpController);
3332
HttpGet get = new HttpGet(this.httpController.getServer() + getZulipAPIUrl());
3433
return performRequest(getParameters(), get);

0 commit comments

Comments
 (0)