Commit Graph

36 Commits

Author SHA1 Message Date
Zhengkai Wang dfb7e62a3d add DisableDNSResolution for TCPDialer. Sometimes, users do not need to use DNS resolution because they have already determined that the requested address is a list of IP addresses. (#1702)
Co-authored-by: wangzhengkai.wzk <wangzhengkai.wzk@alibaba-inc.com>
2024-02-10 10:00:01 +01:00
Oleksandr Redko 12949de784 chore: Set max line length to 130 characters (#1676) 2023-12-05 19:49:41 +01:00
Aviv Carmi 8ca7a9c89c add support for custom dial function with timeouts (#1669)
* add support for custom dial function with timeouts

* fix linting

---------

Co-authored-by: Aviv Carmi <aviv@perimeterx.com>
2023-11-27 13:46:43 +01:00
Oleksandr Redko f196617f55 chore: Use 'any' instead of 'interface{}' (#1666)
gofmt -w -r "interface{} -> any" -l .
2023-11-24 11:33:04 +01:00
Oleksandr Redko d3397c64ed Enable wastedassign, whitespace linters; fix issues (#1665) 2023-11-24 11:32:11 +01:00
un000 6b68042b6c Use timeout in TCPDialer to resolveTCPAddrs (#1582) 2023-06-25 16:13:07 +02:00
Oleksandr Redko ffdf59d04c Enable gofumpt linter; format code gofumpt -w . (#1576) 2023-06-13 15:18:59 +02:00
Oleksandr Redko f84e2346ba Rename unexported funcs, vars to match common Go (#1488)
See https://github.com/golang/go/wiki/CodeReviewComments#initialisms
and https://go.dev/doc/effective_go#mixed-caps
2023-02-10 21:34:49 +08:00
Andy Pan b32a3dda13 Use time.Until(deadline) instead of -time.Since(deadline) (#1434) 2022-11-16 06:13:29 +02:00
Aoang ea6052464e Add Go 1.19 Support (#1355)
* Update Go Version to Go1.19.x And add cache

* Fix CI Line endings

* Update test CI Go Version to Go1.19.x And add cache

* Update Gosec Security Scanner CI to securego/gosec@v2.12.0

* Format comment

Go 1.19 adds support for links, lists, and clearer headings in doc comments. As part of this change, gofmt now reformats doc comments to make their rendered meaning clearer. See “Go Doc Comments” for syntax details and descriptions of common mistakes now highlighted by gofmt. As another part of this change, the new package go/doc/comment provides parsing and reformatting of doc comments as well as support for rendering them to HTML, Markdown, and text.

ref: https://tip.golang.org/doc/go1.19
ref: https://tip.golang.org/doc/comment

* Fix doc structure
2022-08-14 11:31:57 +02:00
Mikhail Faraponov d19b8727b0 Update tcpdialer.go (#1188) 2022-01-09 16:03:22 +01:00
Erik Dubbelboer 6d4db9bb7e Fix race condition in getTCPAddrs 2021-10-29 20:24:17 +02:00
tyltr 711e421685 feat: improve TCPDialer by sync.map instead of map+mutex (#1106) 2021-09-20 16:44:32 +02:00
Ertuğrul Emre Ertekin c12a06108b TCPDialer :: DNSCacheDuration option (#1046)
* DefaultDNSCacheDuration :: Changed to `var`

* Revert "DefaultDNSCacheDuration :: Changed to `var`"

This reverts commit d836eace9f.

* TCPDialer :: DNSCacheDuration option

* TCPDialer :: DNSCacheDuration option - comment added

* TCPDialer :: DNSCacheDuration option - comment fixed
2021-06-18 13:37:07 +02:00
Shohi Wang c2542e5acf add nil check for LocalAddr (#907) 2020-11-07 08:39:47 +01:00
Vitali Pikulik 56775f4d9f tryDial timeout (#881)
* Change tryDial to handle timeout correctly

* fasthttpproxy/http.go accepts timeout

* Fix example doc

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>

* Improve import in httpproxy

* Simplify tryDial

* Cleanup

* Wait for concurrencyCh

Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
2020-10-03 09:44:36 +02:00
Erik Dubbelboer 11e8301d6c Add LocalAddr to TCPDialer 2020-03-10 12:28:47 +01:00
Erik Dubbelboer 03813ae4bc Fix TCPDialer is not setting ZoneID
Fixes https://github.com/valyala/fasthttp/issues/724
2020-01-12 12:59:21 +01:00
Andy Pan 59b28fe0e5 Resolve code issues from goreportcard.com (#725) 2020-01-12 12:57:42 +01:00
Nikolay Markov bc5b479d85 Custom LookupIPAddr function (#699)
* Custom LookupIPAddr function
* use interface instead of pointer
2019-11-25 15:21:03 +01:00
Nikolay Markov 3fb2eba209 Ability to pass custom DNS resolver to TCPDialer (#689)
* Ability to pass custom DNS resolver to TCPdialer

* Update tcpdialer.go

Co-Authored-By: Erik Dubbelboer <erik@dubbelboer.com>
2019-11-10 19:59:21 +01:00
Erik Dubbelboer 45548243d7 Add TCPDialer 2019-02-04 09:11:02 +00:00
xuecai 627d63dd25 change timer to public api #525 (#527)
* change acquireTimer and releaseTimer to public api
2019-02-03 19:16:39 +00:00
Aliaksandr Valialkin 44f08d5588 Issue #196: avoid returning (nil, nil) from fasthttp.Dial* 2016-10-29 23:02:11 +03:00
Aliaksandr Valialkin f36b47782a removed memory allocations from tryDial. This should improve performance for non-keepalive connections 2016-05-16 17:17:18 +03:00
Aliaksandr Valialkin 9f42f3fe8a tcpdialer: limit the number of concurrent dialers 2016-01-29 13:41:07 +02:00
Aliaksandr Valialkin 359b3a1dd8 Client: fixed a bug with improper dial timeout calculation on dial errors 2016-01-28 22:12:06 +02:00
Aliaksandr Valialkin 601ce0528c Client: increased default dial timeout in order to minimize the number of goroutines blocked in Dial 2016-01-28 21:24:38 +02:00
Aliaksandr Valialkin fe88aefe6e Fixed a typo 2016-01-18 15:37:41 +02:00
Aliaksandr Valialkin 1f7553ed62 Added DialTimeout and DialDualStackTimeout functions 2016-01-18 14:11:19 +02:00
Aliaksandr Valialkin e3369ec00b Dial all the resolved TCP addresses in round-robin manner until the connection is established 2016-01-15 19:41:09 +02:00
Aliaksandr Valialkin a1ea9c0808 Limit the maximum time for establishing TCP connection in Dial and DialDualStack 2016-01-15 19:07:33 +02:00
Aliaksandr Valialkin d383fca082 Made Dial and DialFunc more visible in the documentation 2015-12-08 13:40:27 +02:00
Aliaksandr Valialkin 0ac2d5f35e Removed DialTLS*, since it must be handled by client code 2015-12-07 16:44:14 +02:00
Aliaksandr Valialkin f2bf78799c typo fix 2015-12-07 16:36:15 +02:00
Aliaksandr Valialkin 9c70042061 Exported default TCP dialers used by clients, so custom wrappers may be implemented around these dialers 2015-12-07 16:12:28 +02:00