Skip to content

Commit

Permalink
Fix panic with configurations with multiple event socket connections
Browse files Browse the repository at this point in the history
  • Loading branch information
htrendev committed Jul 9, 2020
1 parent ed6886f commit ea264a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ information, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
| @JDLK7 | Jose Domenech |
| @mintos5 | Michal Škuta |
| @playingbogart | Eugene Bozhet |
| @htrendev | Hristo Trendev |

<!-- to sign, include a single line above this comment containing the following text:
| @username | First Last |
Expand Down
6 changes: 3 additions & 3 deletions agents/fsagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ func (fsa *FSsessions) Connect() error {
}
fsa.conns[connIdx] = fSock
utils.Logger.Info(fmt.Sprintf("<%s> successfully connected to FreeSWITCH at: <%s>", utils.FreeSWITCHAgent, connCfg.Address))
go func() { // Start reading in own goroutine, return on error
if err := fsa.conns[connIdx].ReadEvents(); err != nil {
go func(fsock *fsock.FSock) { // Start reading in own goroutine, return on error
if err := fsock.ReadEvents(); err != nil {
errChan <- err
}
}()
}(fSock)
fsSenderPool, err := fsock.NewFSockPool(5, connCfg.Address, connCfg.Password, 1, fsa.cfg.MaxWaitConnection,
make(map[string][]func(string, int)), make(map[string][]string), utils.Logger.GetSyslog(), connIdx)
if err != nil {
Expand Down

0 comments on commit ea264a2

Please sign in to comment.