You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: android/app/src/main/java/com/httpsms/HttpSmsApiService.kt
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,7 @@ class HttpSmsApiService(private val apiKey: String, private val baseURL: URI) {
93
93
94
94
val response = client.newCall(request).execute()
95
95
if (!response.isSuccessful) {
96
+
response.close()
96
97
Timber.e("error response [${response.body?.string()}] with code [${response.code}] while receiving message [${body}]")
97
98
return
98
99
}
@@ -118,6 +119,7 @@ class HttpSmsApiService(private val apiKey: String, private val baseURL: URI) {
118
119
119
120
val response = client.newCall(request).execute()
120
121
if (!response.isSuccessful) {
122
+
response.close()
121
123
Timber.e("error response [${response.body?.string()}] with code [${response.code}] while sending heartbeat [$body] for owner [$phoneNumber]")
122
124
return
123
125
}
@@ -153,6 +155,7 @@ class HttpSmsApiService(private val apiKey: String, private val baseURL: URI) {
153
155
154
156
val response = client.newCall(request).execute()
155
157
if (!response.isSuccessful) {
158
+
response.close()
156
159
Timber.e("error response [${response.body?.string()}] with code [${response.code}] while sending [${event}] event [${body}] for message with ID [${messageId}]")
157
160
return
158
161
}
@@ -180,6 +183,7 @@ class HttpSmsApiService(private val apiKey: String, private val baseURL: URI) {
180
183
181
184
val response = client.newCall(request).execute()
182
185
if (!response.isSuccessful) {
186
+
response.close()
183
187
Timber.e("error response [${response.body?.string()}] with code [${response.code}] while sending fcm token [${body}]")
184
188
returnnull
185
189
}
@@ -202,6 +206,7 @@ class HttpSmsApiService(private val apiKey: String, private val baseURL: URI) {
202
206
try {
203
207
val response = client.newCall(request).execute()
204
208
if (!response.isSuccessful) {
209
+
response.close()
205
210
Timber.e("error response [${response.body?.string()}] with code [${response.code}] while verifying apiKey [$apiKey]")
206
211
returnPair("Cannot validate the API key. Check if it is correct and try again.", null)
0 commit comments