forked from go-ldap/ldap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch introduces a new type called `messageContext` which is now the return value of `(*Conn).sendMessage()`. The message context object still contains a channel from which methods like, Add(), Bind(), Search(), etc., will receive response packets. It also has a field which holds the message ID as well as a `done` channel which is used to prevent deadlock in the `processMessages()` goroutine. This is accomplished by also changing the `(*Conn).finishMessage()` method to take a message context and close this `done` channel before sending a `MessageFinish` packet to the `processMessages()` goroutine. The `processMessages()` goroutine now has a `messageContexts` map which replaces the `chanResults` map. Now, rather than sending response packets only on the response channels, the `messageContext` has its own `sendResponse()` method which uses a switch that blocks on sending a response packet *or* waiting for its `done` channel to be closed by `finishMessage()`. Docker-DCO-1.1-Signed-off-by: Josh Hawn <[email protected]> (github: jlhawn)
- Loading branch information
Showing
9 changed files
with
416 additions
and
147 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
Oops, something went wrong.