-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for connection cookie if db is 23c or higher
- Loading branch information
1 parent
bce8742
commit 5f2230b
Showing
10 changed files
with
186 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import NIOCore | ||
import struct Foundation.UUID | ||
|
||
struct ConnectionCookieManager: Sendable { | ||
static var shared = ConnectionCookieManager() | ||
|
||
private var store: [String: ConnectionCookie] = [:] | ||
|
||
private init() { } | ||
|
||
func get( | ||
by uuid: UUID, description: Description | ||
) -> ConnectionCookie? { | ||
let key = uuid.uuidString + | ||
(description.serviceName ?? description.sid ?? "") | ||
return store[key] | ||
} | ||
|
||
func set() { | ||
// TOOD | ||
} | ||
} | ||
|
||
struct ConnectionCookie: Sendable { | ||
var protocolVersion: UInt8 | ||
var serverBanner: ByteBuffer | ||
var charsetID: UInt16 | ||
var nationalCharsetID: UInt16 | ||
var flags: UInt8 | ||
var compileCapabilities: ByteBuffer | ||
var runtimeCapabilities: ByteBuffer | ||
var populated: Bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.