mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-12-03 07:42:00 -08:00
Close keepalive when recv() ends in client.go
This commit is contained in:
parent
6e84084bb3
commit
d4960afc97
@ -379,9 +379,8 @@ func (c *Client) sendWithWriter(writer io.Writer, packet []byte) error {
|
|||||||
|
|
||||||
// Loop: Receive data from server
|
// Loop: Receive data from server
|
||||||
func (c *Client) recv(keepaliveQuit chan<- struct{}) {
|
func (c *Client) recv(keepaliveQuit chan<- struct{}) {
|
||||||
defer func() {
|
defer close(keepaliveQuit)
|
||||||
close(keepaliveQuit)
|
|
||||||
}()
|
|
||||||
for {
|
for {
|
||||||
val, err := stanza.NextPacket(c.transport.GetDecoder())
|
val, err := stanza.NextPacket(c.transport.GetDecoder())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user