From 5abb12bdf36b78474f1ac22e05bfa6ea26e78785 Mon Sep 17 00:00:00 2001 From: Christopher Puschmann Date: Fri, 12 Apr 2024 11:27:48 +0200 Subject: [PATCH 1/2] Revert "chore: add comment to `Start` function to inform about possible instability when called (#499)" This reverts commit f09ee91fc0c33a20ff2812663ce058cc329ba396. --- conn.go | 7 +------ v3/conn.go | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/conn.go b/conn.go index 9ac538e1..85b7cd19 100644 --- a/conn.go +++ b/conn.go @@ -265,12 +265,7 @@ func NewConn(conn net.Conn, isTLS bool) *Conn { return l } -// Start initialises goroutines to read replies and process messages. -// -// Deprecated: It is usually not necessary to call this function -// manually. It is public for compatibility reasons and may -// cause a race condition when processing messages. -// See: https://github.com/go-ldap/ldap/issues/356 +// Start initializes goroutines to read responses and process messages func (l *Conn) Start() { go l.reader() go l.processMessages() diff --git a/v3/conn.go b/v3/conn.go index a0df79b1..4824b2d9 100644 --- a/v3/conn.go +++ b/v3/conn.go @@ -265,12 +265,7 @@ func NewConn(conn net.Conn, isTLS bool) *Conn { return l } -// Start initialises goroutines to read replies and process messages. -// -// Deprecated: It is usually not necessary to call this function -// manually. It is public for compatibility reasons and may -// cause a race condition when processing messages. -// See: https://github.com/go-ldap/ldap/issues/356 +// Start initializes goroutines to read responses and process messages func (l *Conn) Start() { go l.reader() go l.processMessages() From b761e469cdeb2a0b1d9c6f369b2205567273d593 Mon Sep 17 00:00:00 2001 From: Christopher Puschmann Date: Fri, 12 Apr 2024 11:37:12 +0200 Subject: [PATCH 2/2] chore: add warning to `Start` comment to inform about possible race conditions --- conn.go | 6 +++++- v3/conn.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/conn.go b/conn.go index 85b7cd19..bf5b07a0 100644 --- a/conn.go +++ b/conn.go @@ -265,7 +265,11 @@ func NewConn(conn net.Conn, isTLS bool) *Conn { return l } -// Start initializes goroutines to read responses and process messages +// Start initialises goroutines to read replies and process messages. +// Warning: Calling this function in addition to Dial or DialURL +// may cause race conditions. +// +// See: https://github.com/go-ldap/ldap/issues/356 func (l *Conn) Start() { go l.reader() go l.processMessages() diff --git a/v3/conn.go b/v3/conn.go index 4824b2d9..05febbca 100644 --- a/v3/conn.go +++ b/v3/conn.go @@ -265,7 +265,11 @@ func NewConn(conn net.Conn, isTLS bool) *Conn { return l } -// Start initializes goroutines to read responses and process messages +// Start initialises goroutines to read replies and process messages. +// Warning: Calling this function in addition to Dial or DialURL +// may cause race conditions. +// +// See: https://github.com/go-ldap/ldap/issues/356 func (l *Conn) Start() { go l.reader() go l.processMessages()