Skip to content

Commit

Permalink
Merge branch 'mqtt5-unsubscribe' into mqtt5-negative-time
Browse files Browse the repository at this point in the history
  • Loading branch information
sbSteveK committed May 2, 2024
2 parents 594d19a + c9e17cd commit c0c704a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions Source/AwsCommonRuntimeKit/mqtt/Mqtt5Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public class Mqtt5Client {
}
}



/// Tells the client to attempt to subscribe to one or more topic filters.
///
/// - Parameters:
Expand Down Expand Up @@ -204,8 +202,8 @@ private func publishCompletionCallback(packet_type: aws_mqtt5_packet_type,
}

private func unsubscribeCompletionCallback(unsubackPacket: UnsafePointer<aws_mqtt5_packet_unsuback_view>?,
errorCode: Int32,
userData: UnsafeMutableRawPointer?) {
errorCode: Int32,
userData: UnsafeMutableRawPointer?) {
let continuationCore = Unmanaged<ContinuationCore<UnsubackPacket>>.fromOpaque(userData!).takeRetainedValue()

guard errorCode == AWS_OP_SUCCESS else {
Expand All @@ -217,4 +215,4 @@ private func unsubscribeCompletionCallback(unsubackPacket: UnsafePointer<aws_mqt
}

continuationCore.continuation.resume(returning: unsuback)
}
}
8 changes: 4 additions & 4 deletions Source/AwsCommonRuntimeKit/mqtt/Mqtt5Packets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ public class SubscribePacket: CStruct {
subscriptionIdentifier: UInt32? = nil,
userProperties: [UserProperty]? = nil) {
self.init(subscriptions: [Subscription(topicFilter: topicFilter,
qos: qos,
noLocal: noLocal,
retainAsPublished: retainAsPublished,
retainHandlingType: retainHandlingType)],
qos: qos,
noLocal: noLocal,
retainAsPublished: retainAsPublished,
retainHandlingType: retainHandlingType)],
subscriptionIdentifier: subscriptionIdentifier,
userProperties: userProperties)
}
Expand Down

0 comments on commit c0c704a

Please sign in to comment.