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
@@ -21,10 +21,12 @@ func TestHTTPInput(t *testing.T) {
wg.Done()
})
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)
address := strings.Replace(input.listener.Addr().String(), "[::]", "127.0.0.1", -1)
@@ -55,10 +57,12 @@ func TestInputHTTPLargePayload(t *testing.T) {
}
wg.Done()
})
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)
wg.Add(1)
address := strings.Replace(input.listener.Addr().String(), "[::]", "127.0.0.1", -1)