Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
cpuschma authored Apr 1, 2024
2 parents a3e5bcd + 87d782b commit 3600fa8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ func (r *searchResponse) start(ctx context.Context, searchRequest *SearchRequest

foundSearchSingleResultDone := false
for !foundSearchSingleResultDone {
r.conn.Debug.Printf("%d: waiting for response", msgCtx.id)
select {
case <-ctx.Done():
r.conn.Debug.Printf("%d: %s", msgCtx.id, ctx.Err().Error())
return
default:
r.conn.Debug.Printf("%d: waiting for response", msgCtx.id)
packetResponse, ok := <-msgCtx.responses
case packetResponse, ok := <-msgCtx.responses:
if !ok {
err := NewError(ErrorNetwork, errors.New("ldap: response channel closed"))
r.ch <- &SearchSingleResult{Error: err}
Expand Down
5 changes: 2 additions & 3 deletions v3/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ func (r *searchResponse) start(ctx context.Context, searchRequest *SearchRequest

foundSearchSingleResultDone := false
for !foundSearchSingleResultDone {
r.conn.Debug.Printf("%d: waiting for response", msgCtx.id)
select {
case <-ctx.Done():
r.conn.Debug.Printf("%d: %s", msgCtx.id, ctx.Err().Error())
return
default:
r.conn.Debug.Printf("%d: waiting for response", msgCtx.id)
packetResponse, ok := <-msgCtx.responses
case packetResponse, ok := <-msgCtx.responses:
if !ok {
err := NewError(ErrorNetwork, errors.New("ldap: response channel closed"))
r.ch <- &SearchSingleResult{Error: err}
Expand Down

0 comments on commit 3600fa8

Please sign in to comment.