Skip to content

Commit d4960af

Browse files
author
rcorniere
committed
Close keepalive when recv() ends in client.go
1 parent 6e84084 commit d4960af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,8 @@ func (c *Client) sendWithWriter(writer io.Writer, packet []byte) error {
379379

380380
// Loop: Receive data from server
381381
func (c *Client) recv(keepaliveQuit chan<- struct{}) {
382-
defer func() {
383-
close(keepaliveQuit)
384-
}()
382+
defer close(keepaliveQuit)
383+
385384
for {
386385
val, err := stanza.NextPacket(c.transport.GetDecoder())
387386
if err != nil {

0 commit comments

Comments
 (0)