Make plugin not global. Revert last-chunk bytes to correct value (#755)

Make Plugins variable not global to fix concurrency in test
Revert last-chunk in chunked transfer coding to correct value (https://tools.ietf.org/html/rfc2616#section-3.6.1) fyi @bruce34
This commit is contained in:
Romanenko Alexey
2020-05-27 21:03:40 +03:00
committed by GitHub
parent df14b29e74
commit 2d78f195d2
15 changed files with 190 additions and 127 deletions
+10 -6
View File
@@ -19,10 +19,12 @@ func TestTCPOutput(t *testing.T) {
input := NewTestInput()
output := NewTCPOutput(listener.Addr().String(), &TCPOutputConfig{})
Plugins.Inputs = []io.Reader{input}
Plugins.Outputs = []io.Writer{output}
plugins := &InOutPlugins{
Inputs: []io.Reader{input},
Outputs: []io.Writer{output},
}
go Start(quit)
go Start(plugins, quit)
for i := 0; i < 100; i++ {
wg.Add(1)
@@ -71,10 +73,12 @@ func BenchmarkTCPOutput(b *testing.B) {
input := NewTestInput()
output := NewTCPOutput(listener.Addr().String(), &TCPOutputConfig{})
Plugins.Inputs = []io.Reader{input}
Plugins.Outputs = []io.Writer{output}
plugins := &InOutPlugins{
Inputs: []io.Reader{input},
Outputs: []io.Writer{output},
}
go Start(quit)
go Start(plugins, quit)
b.ResetTimer()
for i := 0; i < b.N; i++ {