Re-add some functionality lost during last dep update (#3636)

This commit is contained in:
Jeff Mitchell 2017-12-01 10:18:26 -05:00 committed by GitHub
parent c2cef877f4
commit eed45793b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,7 @@ func pathConfig(b *backend) *framework.Path {
"read_timeout": &framework.FieldSchema{ "read_timeout": &framework.FieldSchema{
Type: framework.TypeDurationSecond, Type: framework.TypeDurationSecond,
Default: 10, 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{ "nas_port": &framework.FieldSchema{
Type: framework.TypeInt, Type: framework.TypeInt,

View File

@ -154,7 +154,9 @@ func (b *backend) RadiusLogin(req *logical.Request, username string, password st
Timeout: time.Duration(cfg.DialTimeout) * time.Second, 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 { if err != nil {
return nil, logical.ErrorResponse(err.Error()), nil return nil, logical.ErrorResponse(err.Error()), nil
} }