File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ func (serveShell *Server) Run(timeout int) {
164
164
go func () {
165
165
for {
166
166
if sslshell .GetInstance ().Channel ().Shutdown .Load () {
167
+ serveShell .Channel ().Shutdown .Store (true )
167
168
wg .Done ()
168
169
169
170
break
@@ -176,6 +177,7 @@ func (serveShell *Server) Run(timeout int) {
176
177
go func () {
177
178
for {
178
179
if simpleshell .GetServerInstance ().Channel ().Shutdown .Load () {
180
+ serveShell .Channel ().Shutdown .Store (true )
179
181
wg .Done ()
180
182
181
183
break
@@ -189,6 +191,13 @@ func (serveShell *Server) Run(timeout int) {
189
191
wg .Add (1 )
190
192
go func () {
191
193
httpservefile .GetInstance ().Run (timeout )
194
+ for {
195
+ if serveShell .Channel ().Shutdown .Load () {
196
+ serveShell .Shutdown ()
197
+
198
+ break
199
+ }
200
+ }
192
201
}()
193
202
194
203
// wait until the go routines are clean up
Original file line number Diff line number Diff line change @@ -95,10 +95,8 @@ func (shellServer *Server) Run(timeout int) {
95
95
go func () {
96
96
time .Sleep (time .Duration (timeout ) * time .Second )
97
97
if ! shellServer .Channel ().HasSessions () {
98
- if shellServer .Channel ().Shutdown .Load () {
99
- output .PrintFrameworkError ("Timeout met. Shutting down shell listener." )
100
- shellServer .Channel ().Shutdown .Store (true )
101
- }
98
+ output .PrintFrameworkError ("Timeout met. Shutting down shell listener." )
99
+ shellServer .Channel ().Shutdown .Store (true )
102
100
}
103
101
}()
104
102
// Track if the shutdown is signaled for any reason.
You can’t perform that action at this time.
0 commit comments