mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Formatting fixes
This commit is contained in:
+1
-1
@@ -2,9 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"time"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
+3
-3
@@ -45,9 +45,9 @@ func (i *HTTPInput) handler(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, http.StatusText(200), 200)
|
||||
|
||||
select {
|
||||
case i.data <- buf:
|
||||
default:
|
||||
Debug("[INPUT-HTTP] Dropping requests because output can't process them fast enough")
|
||||
case i.data <- buf:
|
||||
default:
|
||||
Debug("[INPUT-HTTP] Dropping requests because output can't process them fast enough")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -1,14 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/buger/gor/proto"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"os/exec"
|
||||
"log"
|
||||
"github.com/buger/gor/proto"
|
||||
)
|
||||
|
||||
func TestHTTPInput(t *testing.T) {
|
||||
@@ -37,7 +37,6 @@ func TestHTTPInput(t *testing.T) {
|
||||
close(quit)
|
||||
}
|
||||
|
||||
|
||||
func TestInputHTTPLargePayload(t *testing.T) {
|
||||
wg := new(sync.WaitGroup)
|
||||
quit := make(chan int)
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ func TestEchoMiddleware(t *testing.T) {
|
||||
// Should receive 2 requests from original + 2 from replayed
|
||||
client := NewHTTPClient(from.URL, &HTTPClientConfig{Debug: false})
|
||||
|
||||
for i:=0; i<10; i++ {
|
||||
for i := 0; i < 10; i++ {
|
||||
wg.Add(4)
|
||||
// Request should be echoed
|
||||
client.Get("/a")
|
||||
|
||||
@@ -144,7 +144,7 @@ func (t *Listener) readRAWSocket() {
|
||||
newBuf := make([]byte, n)
|
||||
copy(newBuf, buf[:n])
|
||||
|
||||
go func(newBuf []byte){
|
||||
go func(newBuf []byte) {
|
||||
t.packetsChan <- ParseTCPPacket(addr, newBuf)
|
||||
}(newBuf)
|
||||
}
|
||||
@@ -257,4 +257,4 @@ func (t *Listener) Close() {
|
||||
close(t.quit)
|
||||
t.conn.Close()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user