Skip to content

Commit

Permalink
fix: not stop when error occurred using pmux
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Apr 29, 2024
1 parent 4ba2623 commit 166ef13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ func clientHandleWithPmux(ln net.Listener, httpClient *http.Client, headers []pi
for {
conn, err := ln.Accept()
if err != nil {
break
cmd.Vlog.Log(
fmt.Sprintf("error(accept): %v", errors.WithStack(err)),
fmt.Sprintf("error(accept): %+v", errors.WithStack(err)),
)
continue
}
stream, err := pmuxClient.Open()
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ func serverHandleWithPmux(httpClient *http.Client, headers []piping_util.KeyValu
for {
stream, err := pmuxServer.Accept()
if err != nil {
return err
cmd.Vlog.Log(
fmt.Sprintf("error(pmux accept): %v", errors.WithStack(err)),
fmt.Sprintf("error(pmux accept): %+v", errors.WithStack(err)),
)
continue
}
conn := dialLoop()
go func() {
Expand Down

0 comments on commit 166ef13

Please sign in to comment.