Commit Graph

79 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 9fa69c74af Embed noCopy struct into structs, which mustn't be copied
This should help `go vet` detecting invalid structs' copyings.
See https://github.com/golang/go/issues/8005#issuecomment-190753527 for details.
2016-03-04 16:57:24 +02:00
Aliaksandr Valialkin 3546c31c2b Issue #60: skip body copying in DoTimeout. This should improve DoTimeout performance when dealing with big request and/or response bodies 2016-03-01 01:13:50 +02:00
Aliaksandr Valialkin e252d37e21 Issue #57: Added DisableHeaderNamesNormalizing config option to Client and HostClient to be consistent with the corresponding option in Server 2016-02-29 13:11:32 +02:00
Aliaksandr Valialkin 7583b9b2ac client: use exponential backoff algorithm for sleeping between unsuccessful attempts to obtain free connection to the server. This should reduce CPU usage 2016-02-22 19:05:46 +02:00
Aliaksandr Valialkin 0ab0d45a50 Eliminated two memory allocations when client follows redirect 2016-02-19 17:27:47 +02:00
Aliaksandr Valialkin 9c9b5abffa Documentation update according to golint 2016-02-12 17:47:57 +02:00
Aliaksandr Valialkin df85922f86 Added (Get|Do)Deadline helper functions to Client and HostClient 2016-02-10 13:35:48 +02:00
Aliaksandr Valialkin a2e6d65e9d Issue #15: return more clear error if the server forgets sending 'Connection: close' response header before closing the connection 2016-02-05 13:45:46 +02:00
Aliaksandr Valialkin df213349e2 client: use TLS session cache by default 2016-02-04 20:24:00 +02:00
Aliaksandr Valialkin c450104658 Client: made more clear timeout handling 2016-01-29 13:38:56 +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 576ba8868b Return immediately on ErrDialTimeout when dialing HostClient hosts 2016-01-15 19:12:09 +02:00
Aliaksandr Valialkin a5f4f2e007 Dial all available addresses in HostClient.Addrs before giving up 2016-01-15 19:08:40 +02:00
Aliaksandr Valialkin c78eb83578 Client: re-send idempotent requests after more unsuccessful cases 2016-01-15 18:30:13 +02:00
Aliaksandr Valialkin b0ded12af6 Do not create new connection on idempotent requests' retry, since it has little sense 2016-01-15 16:56:30 +02:00
Aliaksandr Valialkin 92b182c4b1 Added ability to limit the maximum connection duration in HostClient 2016-01-13 14:06:05 +02:00
Aliaksandr Valialkin c8f577c7f1 Added ability to balance requests among multiple upstream hosts via HostClient 2016-01-12 11:08:24 +02:00
Aliaksandr Valialkin c5d9023043 Issue #30: properly handle content-length for HEAD responses 2016-01-05 18:02:50 +02:00
Aliaksandr Valialkin 8cd2f8da6b Added more parallel benchmarks for the client 2015-12-29 17:18:15 +02:00
Aliaksandr Valialkin 95093e35cf Removed redundant Reset() calls on bufio.Reader/bufio.Writer/gzipWriter/flateWriter before returning them to the pool, since Reset() is immediately called after these instances are obtained from pool 2015-12-29 15:10:14 +02:00
Aliaksandr Valialkin d2db95337f Removed 'v interface{}' hack from structs managed via sync.Pool, since it has no sense 2015-12-23 11:39:40 +02:00
Aliaksandr Valialkin cf6efe4c3f Export AcquireRequest, AcquireResponse, ReleaseRequest and ReleaseResponse 2015-12-19 20:25:03 +02:00
Aliaksandr Valialkin f520ed8177 Follow-up tests after the pull request #19: added missing tests 2015-12-16 20:00:17 +02:00
招牌疯子 cd6b2ebf66 Fixed client copy resp from respCopy inversely 2015-12-16 13:50:03 +08:00
Aliaksandr Valialkin 0ac2d5f35e Removed DialTLS*, since it must be handled by client code 2015-12-07 16:44:14 +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
Aliaksandr Valialkin 32022e42d0 Documentation fix for Do() 2015-12-07 13:55:59 +02:00
Aliaksandr Valialkin 4ac44f0c6c Mention which structs are safe for use from concurrently running goroutines (Server, Client and HostClient) and which structs are unsafe to use from concurrently running goroutines - all the other 2015-12-03 13:38:59 +02:00
Aliaksandr Valialkin 3c903772f2 Avoid memory allocation when cleaning stale workers and connections 2015-12-02 08:24:55 +02:00
Aliaksandr Valialkin 235d4932da Check for stale workers and connections every 10 seconds instead of every second. This should reduce cleaners' overhead 2015-12-01 13:42:53 +02:00
Aliaksandr Valialkin a3965934a1 Simplify GC life by zeroing references to closed worker chans and client conns 2015-12-01 13:32:05 +02:00
Aliaksandr Valialkin d0289e11d9 Allow TCP addresses without port in HostClient 2015-11-30 18:22:45 +02:00
Aliaksandr Valialkin f214dc327f Scalability improvement: do not move read workers' queue when cleaning old workers. This should reduce latencies when server serves multi-million concurrent connections 2015-11-30 11:26:39 +02:00
Aliaksandr Valialkin 3a31c4bdef cleaned up some cruft in Client.Do 2015-11-29 12:22:18 +02:00
Aliaksandr Valialkin 3a406649a1 Retry PUT requests as they are idempotent according to http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html 2015-11-29 12:07:46 +02:00
Aliaksandr Valialkin a86ebd88ea Issue #7: fixed unaligned 64-bit access on ARM in client code 2015-11-28 20:10:18 +02:00
Aliaksandr Valialkin 8563a2e762 Follow redirects in client Get* and Post* methods. Added Redirect method to RequestCtx. 2015-11-28 14:47:19 +02:00
Aliaksandr Valialkin 87d525b89a Removed unused Logger from Client and HostClient 2015-11-28 10:42:01 +02:00
Aliaksandr Valialkin df6fda8c33 Added ability to limit request body size on the server and response body size on the client 2015-11-27 13:22:15 +02:00
Aliaksandr Valialkin a3fd75d237 Eliminated memory allocations from client's DoTimeout and GetTimeout 2015-11-26 17:04:27 +02:00
Aliaksandr Valialkin 79313ec7a9 Fixed a bug in ipv4 addresses resolution if the resolved ip addresses contain non-zero number of ipv6 addresses 2015-11-25 15:23:42 +02:00
Aliaksandr Valialkin 6816e2b03c Clients dial only ipv4 addresses by default due to bad ipv6 support in our networks. Use DialDualStack for dialing both ipv4 and ipv6 addresses 2015-11-25 15:14:31 +02:00
Aliaksandr Valialkin 0fa8e8efc7 Client: dial both tcp4 and tcp6 addresses 2015-11-25 14:30:51 +02:00
Aliaksandr Valialkin 0b2690febe Added GetTimeout method to client 2015-11-25 13:45:34 +02:00
Aliaksandr Valialkin 9decd4d0ac Properly handle negative timeouts in client's DoTimeout 2015-11-24 17:33:25 +02:00
Aliaksandr Valialkin c6fcca3ae6 Added ReadTimeout and WriteTimeout settings to client 2015-11-24 17:14:34 +02:00
Aliaksandr Valialkin 3a1a2ddfc8 Randomize sleep time in Client.DoTimeout when waiting for free connection to the host 2015-11-23 12:26:32 +02:00
Aliaksandr Valialkin 46ac549ae1 Access URI members via accessors 2015-11-22 13:05:24 +02:00
Aliaksandr Valialkin a862d8592a Documentation update 2015-11-22 06:33:58 +02:00
Aliaksandr Valialkin 2d18e84d04 Handle 'no free connections to host' error when doing request with user-defined timeout 2015-11-22 06:00:04 +02:00