mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Fix CI comments.
This commit is contained in:
+1
-1
@@ -109,7 +109,7 @@ func CopyMulty(src io.Reader, writers ...io.Writer) error {
|
|||||||
var nr int
|
var nr int
|
||||||
nr, err := src.Read(buf)
|
nr, err := src.Read(buf)
|
||||||
|
|
||||||
if err == io.EOF || err == StoppedError {
|
if err == io.EOF || err == ErrorStopped {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
+1
-1
@@ -156,7 +156,7 @@ func (i *FileInput) Read(data []byte) (int, error) {
|
|||||||
var buf []byte
|
var buf []byte
|
||||||
select {
|
select {
|
||||||
case <-i.exit:
|
case <-i.exit:
|
||||||
return 0, StoppedError
|
return 0, ErrorStopped
|
||||||
case buf = <-i.data:
|
case buf = <-i.data:
|
||||||
}
|
}
|
||||||
copy(data, buf)
|
copy(data, buf)
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ func (i *HTTPInput) Read(data []byte) (int, error) {
|
|||||||
var buf []byte
|
var buf []byte
|
||||||
select {
|
select {
|
||||||
case <-i.stop:
|
case <-i.stop:
|
||||||
return 0, StoppedError
|
return 0, ErrorStopped
|
||||||
case buf = <-i.data:
|
case buf = <-i.data:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ func (i *RAWInput) Read(data []byte) (int, error) {
|
|||||||
var msg *raw.TCPMessage
|
var msg *raw.TCPMessage
|
||||||
select {
|
select {
|
||||||
case <-i.quit:
|
case <-i.quit:
|
||||||
return 0, StoppedError
|
return 0, ErrorStopped
|
||||||
case msg = <-i.data:
|
case msg = <-i.data:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ func (i *TCPInput) Read(data []byte) (int, error) {
|
|||||||
var buf []byte
|
var buf []byte
|
||||||
select {
|
select {
|
||||||
case <-i.stop:
|
case <-i.stop:
|
||||||
return 0, StoppedError
|
return 0, ErrorStopped
|
||||||
case buf = <-i.data:
|
case buf = <-i.data:
|
||||||
}
|
}
|
||||||
copy(data, buf)
|
copy(data, buf)
|
||||||
|
|||||||
+3
-2
@@ -7,7 +7,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var StoppedError = errors.New("reading stopped")
|
// ErrorStopped is the error returned when the go routines reading the input is stopped.
|
||||||
|
var ErrorStopped = errors.New("reading stopped")
|
||||||
|
|
||||||
// TestInput used for testing purpose, it allows emitting requests on demand
|
// TestInput used for testing purpose, it allows emitting requests on demand
|
||||||
type TestInput struct {
|
type TestInput struct {
|
||||||
@@ -28,7 +29,7 @@ func (i *TestInput) Read(data []byte) (int, error) {
|
|||||||
var buf []byte
|
var buf []byte
|
||||||
select {
|
select {
|
||||||
case <-i.stop:
|
case <-i.stop:
|
||||||
return 0, StoppedError
|
return 0, ErrorStopped
|
||||||
case buf = <-i.data:
|
case buf = <-i.data:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user