mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
remove the testserver package
This commit is contained in:
parent
dde21d2f72
commit
07dcbc8496
13 changed files with 171 additions and 202 deletions
|
@ -19,7 +19,6 @@ import (
|
|||
|
||||
"github.com/lucas-clemente/quic-go"
|
||||
"github.com/lucas-clemente/quic-go/http3"
|
||||
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
|
||||
"github.com/lucas-clemente/quic-go/internal/testdata"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/lucas-clemente/quic-go/quictrace"
|
||||
|
@ -41,6 +40,17 @@ type Size interface {
|
|||
Size() int64
|
||||
}
|
||||
|
||||
// See https://en.wikipedia.org/wiki/Lehmer_random_number_generator
|
||||
func generatePRData(l int) []byte {
|
||||
res := make([]byte, l)
|
||||
seed := uint64(1)
|
||||
for i := 0; i < l; i++ {
|
||||
seed = seed * 48271 % 2147483647
|
||||
res[i] = byte(seed)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
var tracer quictrace.Tracer
|
||||
|
||||
func init() {
|
||||
|
@ -93,7 +103,7 @@ func setupHandler(www string, trace bool) http.Handler {
|
|||
w.WriteHeader(400)
|
||||
return
|
||||
}
|
||||
w.Write(testserver.GeneratePRData(int(num)))
|
||||
w.Write(generatePRData(int(num)))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue