From 1d2d99cba311e04b8d58f5d113ee07086c3e64f6 Mon Sep 17 00:00:00 2001 From: Blless Date: Thu, 29 Nov 2018 18:06:36 +0800 Subject: [PATCH] Add MaxIdemponentCallAttempts to fasthttp.Client (#484) * Add MaxIdemponentCallAttempts to fasthttp.Client --- client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client.go b/client.go index bde76c0..05fad63 100644 --- a/client.go +++ b/client.go @@ -188,6 +188,11 @@ type Client struct { // after DefaultMaxIdleConnDuration. MaxIdleConnDuration time.Duration + // Maximum number of attempts for idempotent calls + // + // DefaultMaxIdemponentCallAttempts is used if not set. + MaxIdemponentCallAttempts int + // Per-connection buffer size for responses' reading. // This also limits the maximum header size. // @@ -400,6 +405,7 @@ func (c *Client) Do(req *Request, resp *Response) error { TLSConfig: c.TLSConfig, MaxConns: c.MaxConnsPerHost, MaxIdleConnDuration: c.MaxIdleConnDuration, + MaxIdemponentCallAttempts: c.MaxIdemponentCallAttempts, ReadBufferSize: c.ReadBufferSize, WriteBufferSize: c.WriteBufferSize, ReadTimeout: c.ReadTimeout,