aboutsummaryrefslogtreecommitdiff
path: root/header.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2022-07-29 19:03:15 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-29 19:03:15 +0200
commita5f448fc970972ab47113971d898a22fb28fef52 (patch)
tree826fe1e91cdca5002f7db0bef4b8dfdcf55efddc /header.go
parentPrevent overflow and panic on large HTTP responses (#1351) (diff)
downloadfasthttp-a5f448fc970972ab47113971d898a22fb28fef52.tar.gz
fasthttp-a5f448fc970972ab47113971d898a22fb28fef52.tar.bz2
fasthttp-a5f448fc970972ab47113971d898a22fb28fef52.zip
Improve Client timeout (#1346)
Don't run requests in a separate Goroutine anymore. Instead use proper conn deadlines to enforce timeouts. - Also contains some linting fixes.
Diffstat (limited to 'header.go')
-rw-r--r--header.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/header.go b/header.go
index e960177..323b3f0 100644
--- a/header.go
+++ b/header.go
@@ -868,7 +868,7 @@ func (h *RequestHeader) HasAcceptEncodingBytes(acceptEncoding []byte) bool {
// i.e. the number of times f is called in VisitAll.
func (h *ResponseHeader) Len() int {
n := 0
- h.VisitAll(func(k, v []byte) { n++ })
+ h.VisitAll(func(_, _ []byte) { n++ })
return n
}
@@ -876,7 +876,7 @@ func (h *ResponseHeader) Len() int {
// i.e. the number of times f is called in VisitAll.
func (h *RequestHeader) Len() int {
n := 0
- h.VisitAll(func(k, v []byte) { n++ })
+ h.VisitAll(func(_, _ []byte) { n++ })
return n
}
@@ -1077,7 +1077,7 @@ func (h *ResponseHeader) VisitAll(f func(key, value []byte)) {
f(strServer, server)
}
if len(h.cookies) > 0 {
- visitArgs(h.cookies, func(k, v []byte) {
+ visitArgs(h.cookies, func(_, v []byte) {
f(strSetCookie, v)
})
}