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:
Marc Lallaouret
2016-06-16 22:33:07 +06:00
committed by Leonid Bugaev
parent 95eecb6b1c
commit d0e1858eb3
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
}