mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
fix output_ws and output_tcp deadlock (#1172)
This commit is contained in:
+1
-1
@@ -88,8 +88,8 @@ func (o *TCPOutput) worker(bufferIndex int) {
|
||||
|
||||
if err != nil {
|
||||
Debug(2, "INFO: TCP output connection closed, reconnecting")
|
||||
o.buf[bufferIndex] <- msg
|
||||
go o.worker(bufferIndex)
|
||||
o.buf[bufferIndex] <- msg
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -97,8 +97,8 @@ func (o *WebSocketOutput) worker(bufferIndex int) {
|
||||
err = conn.WriteMessage(websocket.BinaryMessage, append(msg.Meta, msg.Data...))
|
||||
if err != nil {
|
||||
Debug(2, "INFO: WebSocket output connection closed, reconnecting "+err.Error())
|
||||
o.buf[bufferIndex] <- msg
|
||||
go o.worker(bufferIndex)
|
||||
o.buf[bufferIndex] <- msg
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user