Skip to content

Commit

Permalink
fix websocket callback
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed May 13, 2024
1 parent bf10b08 commit 979d775
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/AwsCommonRuntimeKit/mqtt/Mqtt5Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ internal func MqttClientWebsocketTransform(
_ complete_fn: (@convention(c) (OpaquePointer?, Int32, UnsafeMutableRawPointer?) -> Void)?,
_ complete_ctx: UnsafeMutableRawPointer?) {

let client = Unmanaged<Mqtt5Client>.fromOpaque(complete_ctx!).takeUnretainedValue()
let client = Unmanaged<Mqtt5Client>.fromOpaque(user_data!).takeUnretainedValue()

// validate the callback flag, if flag is false, return
client.rwlock.read {
client.rwlock.read {
if client.callbackFlag == false { return }

guard let request else {
Expand Down

0 comments on commit 979d775

Please sign in to comment.