Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicriordan committed Dec 2, 2023
1 parent e1cd84e commit 0c1d6b2
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pkgs/payloader/payloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/valyala/fasthttp"
golanghttp2 "golang.org/x/net/http2"
"log"
"net"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -67,6 +68,20 @@ func tlsConfig() *tls.Config {
func testStartHTTP1Server(addr string) {
var err error
testFastHTTP = fasthttp.Server{
ErrorHandler: func(ctx *fasthttp.RequestCtx, err error) {
log.Printf("Got error from req %+v", ctx)
log.Println(err)
},
ConnState: func(conn net.Conn, state fasthttp.ConnState) {
switch state {
case fasthttp.StateNew:
log.Printf("New conn from %s \n", conn.RemoteAddr().String())
case fasthttp.StateClosed:
log.Printf("Closed conn from %s \n", conn.RemoteAddr().String())
case fasthttp.StateIdle:
log.Printf("Idle conn from %s \n", conn.RemoteAddr().String())
}
},
Handler: func(c *fasthttp.RequestCtx) {
_, err = c.WriteString("hello")
if err != nil {
Expand Down Expand Up @@ -128,9 +143,7 @@ func testStartHTTP2Server(addr string) {
}

func TestPayLoader_RunFastHTTP1NonSSL(t *testing.T) {
testPayLoader_Run(t, "http://localhost:8888", "fasthttp", func() {
testFastHTTP.Shutdown()
})
testPayLoader_Run(t, "http://localhost:8888", "fasthttp", nil)
}

func TestPayLoader_RunFastHTTP1SSL(t *testing.T) {
Expand Down

0 comments on commit 0c1d6b2

Please sign in to comment.