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 a new issue