Skip to content

Commit

Permalink
Merge branch 'feat/libcurl' into 'master'
Browse files Browse the repository at this point in the history
chore: expose HttpClient and HttpClientCanceler

See merge request TankerHQ/sdk-android!268
  • Loading branch information
Bastien Riviere committed Jul 22, 2022
2 parents 900b7fa + 4dd52c8 commit 1524534
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions tanker-bindings/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ tasks.dokkaJavadoc.configure {
matchingRegex.set("io\\.tanker\\.api\\.Identity")
suppress.set(true)
}

// Exclude HttpClient api
perPackageOption {
matchingRegex.set("io\\.tanker\\.api\\.HttpClient")
suppress.set(true)
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions tanker-bindings/src/main/kotlin/io/tanker/api/HttpClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import okhttp3.RequestBody.Companion.toRequestBody
import java.io.IOException
import java.util.concurrent.atomic.AtomicInteger

internal class HttpClient(private val tankerLib: TankerLib, private val sdkType: String, private val sdkVersion: String) : TankerLib.HttpSendRequestCallback {
class HttpClient(private val tankerLib: TankerLib, private val sdkType: String, private val sdkVersion: String) : TankerLib.HttpSendRequestCallback {
companion object {
val JSON = "application/json; charset=utf-8".toMediaTypeOrNull()!!
}
Expand Down Expand Up @@ -96,7 +96,7 @@ internal class HttpClient(private val tankerLib: TankerLib, private val sdkType:
}
}

internal class HttpClientCanceler(private val httpClient: HttpClient) : TankerLib.HttpCancelRequestCallback {
class HttpClientCanceler(private val httpClient: HttpClient) : TankerLib.HttpCancelRequestCallback {
override fun callback(crequest: TankerHttpRequest, requestHandle: Pointer?, data: Pointer?) {
val requestId = Pointer.nativeValue(requestHandle).toInt()
synchronized(httpClient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.tanker.bindings.DatastoreLib
import io.tanker.bindings.TankerLib
import io.tanker.datastore.DatastoreOptions

internal class HttpOptions : Structure() {
class HttpOptions : Structure() {
@JvmField var httpSendRequest: TankerLib.HttpSendRequestCallback? = null
@JvmField var httpCancelRequest: TankerLib.HttpCancelRequestCallback? = null
@JvmField var httpData: Pointer? = Pointer.NULL
Expand Down

0 comments on commit 1524534

Please sign in to comment.