From f1e173743b3ceb1d5df441f985847674d56081df Mon Sep 17 00:00:00 2001 From: Christopher Puschmann Date: Mon, 1 Apr 2024 18:06:11 +0200 Subject: [PATCH] chore: add comment to `Start` function to inform about possible instability when called --- conn.go | 7 ++++++- v3/conn.go | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/conn.go b/conn.go index 85b7cd1..9ac538e 100644 --- a/conn.go +++ b/conn.go @@ -265,7 +265,12 @@ 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. +// +// 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 func (l *Conn) Start() { go l.reader() go l.processMessages() diff --git a/v3/conn.go b/v3/conn.go index 4824b2d..a0df79b 100644 --- a/v3/conn.go +++ b/v3/conn.go @@ -265,7 +265,12 @@ 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. +// +// 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 func (l *Conn) Start() { go l.reader() go l.processMessages()