Skip to content

Commit

Permalink
fix: reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
woorui committed Nov 26, 2023
1 parent e913b0b commit 96d07ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,9 @@ func (c *Client) handleConn(ctx context.Context, conn frame.Conn) error {
for {
select {
case <-ctx.Done():
se := errors.New("yomo: parent context done")
conn.CloseWithError(se.Error())
return se
conn.CloseWithError("yomo: parent context done")

Check warning on line 224 in core/client.go

View check run for this annotation

Codecov / codecov/patch

core/client.go#L223-L224

Added lines #L223 - L224 were not covered by tests
case <-c.ctx.Done():
se := context.Cause(c.ctx)
conn.CloseWithError(se.Error())
return se
conn.CloseWithError(context.Cause(c.ctx).Error())
case f := <-c.wrCh:
if err := conn.WriteFrame(f); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion core/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (s *Server) handleFrameConn(fconn frame.Conn, logger *slog.Logger) {
return
}

s.connHandler(conn, route) // s.handleConn(conn) with middlewares
s.connHandler(conn, route) // s.handleConnRoute(conn, route) with middlewares

if conn.ClientType() == ClientTypeStreamFunction {
_ = route.Remove(conn.ID())
Expand Down

0 comments on commit 96d07ec

Please sign in to comment.