mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-22 20:38:13 -05:00
fix issue
This commit is contained in:
@@ -123,8 +123,8 @@ func (c *upClient) Login(ctx context.Context, genLogin func(string) (*types.Logi
|
||||
}
|
||||
|
||||
func handleHttpResp(resp *http.Response) (*ctypes.Response, error) {
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusUnauthorized {
|
||||
defer resp.Body.Close()
|
||||
var respWithData ctypes.Response
|
||||
// Note: Body is consumed after decoding, caller should not read it again
|
||||
if err := json.NewDecoder(resp.Body).Decode(&respWithData); err == nil {
|
||||
|
||||
@@ -114,12 +114,13 @@ func (c *proverSession) maintainLogin(ctx context.Context, cliMgr Client, up str
|
||||
waitctx := c.completionCtx
|
||||
c.Unlock()
|
||||
select {
|
||||
case <-waitctx.Done():
|
||||
return c.maintainLogin(ctx, cliMgr, up, param, phase)
|
||||
case <-ctx.Done():
|
||||
nerr = fmt.Errorf("ctx fail")
|
||||
return
|
||||
default:
|
||||
}
|
||||
<-waitctx.Done()
|
||||
return c.maintainLogin(ctx, cliMgr, up, param, phase)
|
||||
}
|
||||
|
||||
if phase < curPhase {
|
||||
|
||||
Reference in New Issue
Block a user