Skip to content

Commit

Permalink
Re-add some functionality lost during last dep update (#3636)
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferai authored Dec 1, 2017
1 parent c2cef87 commit eed4579
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/credential/radius/path_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func pathConfig(b *backend) *framework.Path {
"read_timeout": &framework.FieldSchema{
Type: framework.TypeDurationSecond,
Default: 10,
Description: "Number of seconds before response times out (default: 10). Note: kept for backwards compatibility, currently unused.",
Description: "Number of seconds before response times out (default: 10)",
},
"nas_port": &framework.FieldSchema{
Type: framework.TypeInt,
Expand Down
4 changes: 3 additions & 1 deletion builtin/credential/radius/path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ func (b *backend) RadiusLogin(req *logical.Request, username string, password st
Timeout: time.Duration(cfg.DialTimeout) * time.Second,
},
}
received, err := client.Exchange(context.Background(), packet, hostport)
ctx, cancelFunc := context.WithTimeout(context.Background(), time.Duration(cfg.ReadTimeout)*time.Second)
received, err := client.Exchange(ctx, packet, hostport)
cancelFunc()
if err != nil {
return nil, logical.ErrorResponse(err.Error()), nil
}
Expand Down

0 comments on commit eed4579

Please sign in to comment.