Skip to content

Commit 324f815

Browse files
committed
fix: close error nil conn
1 parent 35564bc commit 324f815

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

cmd/server/main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ func main() {
2424
// app.RunApp(rch)
2525

2626
ch := make(chan os.Signal, 1)
27-
go terminal.RunApplication(terminal.ApplicationSpec{
27+
app := terminal.CreateApplication(terminal.ApplicationSpec{
2828
ConsoleLogBuffer: buf,
2929
Rch: rch,
3030
CloseCh: ch,
3131
})
32+
go app.Run()
3233
<-ch
34+
app.Stop()
3335
os.Exit(0)
3436
}

cmd/server/sessionmanager/bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/server/sessionmanager/server.go

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ func RunServer(rch define.RelayChan, buffer io.Writer) {
3737
}
3838

3939
router.GET("/cert", func(c *gin.Context) {
40-
c.Header("Content-Disposition", "attachment; filename=cert.pem")
41-
c.Header("Content-Type", "application/text/plain")
4240
c.FileAttachment("cert/cert.pem", "cert.pem")
4341
})
4442

cmd/server/terminal/app.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ func CreateApplication(Spec ApplicationSpec) Application {
3030
}
3131
}
3232

33-
func RunApplication(Spec ApplicationSpec) {
34-
app := CreateApplication(Spec)
33+
func (app *Application) Run() {
3534
LogUI := app.CreateLogUI()
3635
TermUI := app.CreateTermUI()
3736
app.LogArea = LogUI
@@ -45,6 +44,10 @@ func RunApplication(Spec ApplicationSpec) {
4544
}
4645
}
4746

47+
func (app *Application) Stop() {
48+
app.UI.Stop()
49+
}
50+
4851
func (app Application) CreateLogUI() *tview.TextView {
4952
LogUI := tview.NewTextView().
5053
SetDynamicColors(true).

0 commit comments

Comments
 (0)