Skip to content

Commit

Permalink
paho Client.ClientConfig is now private
Browse files Browse the repository at this point in the history
Users could previously access/change the ClientConfig held by paho.Client; this invited race conditions (paho.Client could use values from the config at any time and no locking mechanism was provided).

To avoid this, the config is now private and examples etc have been updated. A getter for ClientID has been added (as this was needed in examples); I suspect additional getters may be of benefit (but will await feedback for that).

This may break some users code (but that is probably a good thing)
  • Loading branch information
MattBrittan authored Jan 10, 2024
2 parents e452008 + 5d466dd commit 839e884
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 100 deletions.
2 changes: 1 addition & 1 deletion autopaho/auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func (c *ConnectionManager) PublishViaQueue(ctx context.Context, p *QueuePublish
func (c *ConnectionManager) TerminateConnectionForTest() {
c.mu.Lock()
if c.cli != nil {
_ = c.cli.Conn.Close()
c.cli.TerminateConnectionForTest()
}
c.mu.Unlock()
}
Expand Down
Loading

0 comments on commit 839e884

Please sign in to comment.