diff --git a/CHANGELOG.md b/CHANGELOG.md index 50d51b5..1572e7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ### Changed - Now you can build and install termshark with one command: `go install github.com/gcla/termshark/v2/cmd/termshark` +- Fixed a bug that resulted in stream reassembly sporadically failing and displaying a blank screen. - Termshark will now, by default, suppress errors from tshark. You can change this via the minibuffer `set suppress-tshark-errors` command. - Added a summary of standard error to the error dialogs displayed when a tshark process fails to run diff --git a/cmd/termshark/termshark.go b/cmd/termshark/termshark.go index 5b46776..47dddd7 100644 --- a/cmd/termshark/termshark.go +++ b/cmd/termshark/termshark.go @@ -20,9 +20,9 @@ import ( "github.com/blang/semver" "github.com/gcla/gowid" "github.com/gcla/termshark/v2" - "github.com/gcla/termshark/v2/pkg/cli" "github.com/gcla/termshark/v2/configs/profiles" "github.com/gcla/termshark/v2/pkg/capinfo" + "github.com/gcla/termshark/v2/pkg/cli" "github.com/gcla/termshark/v2/pkg/confwatcher" "github.com/gcla/termshark/v2/pkg/convs" "github.com/gcla/termshark/v2/pkg/fields" @@ -41,7 +41,6 @@ import ( "github.com/mattn/go-isatty" "github.com/shibukawa/configdir" log "github.com/sirupsen/logrus" - "github.com/spf13/viper" "net/http" _ "net/http" @@ -1357,7 +1356,7 @@ Loop: case <-watcher.ConfigChanged(): // Re-read so changes that can take effect immediately do so - if err := viper.ReadInConfig(); err != nil { + if err := profiles.ReadDefaultConfig(dirs[0].Path); err != nil { log.Warnf("Unexpected error re-reading toml config: %v", err) } ui.UpdateRecentMenu(app) diff --git a/pkg/streams/loader.go b/pkg/streams/loader.go index 23209fc..c0f7789 100644 --- a/pkg/streams/loader.go +++ b/pkg/streams/loader.go @@ -205,9 +205,9 @@ func (c *Loader) loadStreamReassemblyAsync(pcapf string, proto string, idx int, log.Infof("Started stream reassembly command %v with pid %d", c.streamCmd, c.streamCmd.Pid()) - termshark.TrackedGo(func() { + defer func() { termChan <- c.streamCmd.Wait() - }, Goroutinewg) + }() pid = c.streamCmd.Pid() procChan <- pid @@ -219,7 +219,7 @@ func (c *Loader) loadStreamReassemblyAsync(pcapf string, proto string, idx int, func() { _, err := ParseReader("", streamOut, ops...) if err != nil { - log.Infof("Stream parser reported error: %v", err) + log.Warnf("Stream parser reported error: %v", err) } }()