mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Fix Close implementation of plugins (#305)
Indeed they do not declare error as return type and so, were not called at the end of the program
This commit is contained in:
committed by
Leonid Bugaev
parent
95eecb6b1c
commit
d0e1858eb3
+2
-1
@@ -189,6 +189,7 @@ func (i *FileInput) emit() {
|
||||
log.Printf("FileInput: end of file '%s'\n", i.path)
|
||||
}
|
||||
|
||||
func (i *FileInput) Close() {
|
||||
func (i *FileInput) Close() error {
|
||||
i.currentFile.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
+2
-1
@@ -97,7 +97,8 @@ func (i *RAWInput) String() string {
|
||||
return "Intercepting traffic from: " + i.address
|
||||
}
|
||||
|
||||
func (i *RAWInput) Close() {
|
||||
func (i *RAWInput) Close() error {
|
||||
i.listener.Close()
|
||||
close(i.quit)
|
||||
return nil
|
||||
}
|
||||
|
||||
+2
-1
@@ -228,7 +228,7 @@ func (o *FileOutput) String() string {
|
||||
return "File output: " + o.file.Name()
|
||||
}
|
||||
|
||||
func (o *FileOutput) Close() {
|
||||
func (o *FileOutput) Close() error {
|
||||
if o.file != nil {
|
||||
if strings.HasSuffix(o.currentName, ".gz") {
|
||||
o.writer.(*gzip.Writer).Close()
|
||||
@@ -237,4 +237,5 @@ func (o *FileOutput) Close() {
|
||||
}
|
||||
o.file.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user