Commit Graph

45 Commits

Author SHA1 Message Date
Aliaksandr Valialkin b0de56d13b Properly set "https" scheme in RequestCtx.URI() for TLS connections 2017-01-15 00:26:21 +02:00
Aliaksandr Valialkin 1c39678a4d client: retry non-idempotent requests if the server closes idle keep-alive connection before receiving the next request
This case usually appears when working with Apache or nginx servers.
See http://httpd.apache.org/docs/2.4/mod/core.html#keepalivetimeout
and http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout
2016-11-28 11:50:36 +02:00
Aliaksandr Valialkin 8ab3351f0a Unshadow err in client test 2016-10-13 17:42:25 +03:00
Aliaksandr Valialkin 93c15ed83c Remove unused variables 2016-10-13 17:40:57 +03:00
Aliaksandr Valialkin 4ca4d0ea09 Client, HostClient, PipelineClient: verify TLS server name 2016-10-12 19:49:23 +03:00
Aliaksandr Valialkin 07f692d02d Revert "Redirection support for Do(*Request, *Response)"
This breaks Get*() with redirects. DoFollowRedirects must be implemented
on top of Do() instead of hacking on internal doRequestFollowRedirects.

This reverts commit 6438022109.
2016-10-05 12:44:51 +03:00
Sick Yoon 6438022109 Redirection support for Do(*Request, *Response) 2016-10-05 12:37:18 +03:00
Aliaksandr Valialkin a52a42acd6 Added HostClient.PendingRequests(), which may be used for balancing load among multiple HostClient instances 2016-09-21 23:03:30 +03:00
Aliaksandr Valialkin 4f66eb3fbb Do not busy wait on free connection in DoDeadline and DoTimeout, since this may result in a lot of goroutines stalled in the busy wait for free connections 2016-09-12 14:19:13 +03:00
Nicolas Bazire 9f7999be97 fix DoDeadline side effect when no free conn (#145) 2016-08-17 20:24:33 +03:00
Aliaksandr Valialkin 881ac52b00 Added support for multiple concurrent connections to server in PipelineClient 2016-07-16 17:36:32 +03:00
Aleksandr Razumov 7304bdd09c explicitly skip tests for platforms that not support unix sockets (#90) 2016-05-05 16:39:31 +03:00
Aleksandr Razumov 0095981a19 fix tests on Windows 2016-05-04 10:08:10 +03:00
Aliaksandr Valialkin 33163198b1 sped up slow tests under 'go test -race' 2016-04-15 13:47:42 +03:00
Aliaksandr Valialkin 316adc4782 PipelineClient.Do: try substituting the oldest request in the pending queue by the current one on queue overflow 2016-04-03 10:58:55 +03:00
Aliaksandr Valialkin 8ae2d3e53c PipelineClinet: added MaxBatchDelay option 2016-04-02 23:18:34 +03:00
Aliaksandr Valialkin ca21b21eba Return ErrPipelineOverflow from PipelineClient.Do if the pending requests' queue is overflown. This should prevent from caller's goroutines leak on stalled pipeline client 2016-04-01 18:21:35 +03:00
Aliaksandr Valialkin 22c9594090 Added PipelineClient for issuing pipelined requests to the server 2016-04-01 18:06:59 +03: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 21a70cc5b8 reduced the time required to run tests with race detector enabled 2016-02-21 13:34:55 +02:00
Aliaksandr Valialkin 0ab0d45a50 Eliminated two memory allocations when client follows redirect 2016-02-19 17:27:47 +02:00
Aliaksandr Valialkin 52ddf98cfd Fixed golint warnings 2016-01-19 12:43:23 +02:00
Aliaksandr Valialkin 81b5321d14 Removed misleading ConnectionCloseReal method from RequestHeader 2016-01-17 00:43:34 +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 84e14eb376 Reduced test time for TestClientManyServers 2015-12-25 12:24:40 +02:00
Aliaksandr Valialkin 052a3cfb65 Substitute EqualBytesStr(s, b) by string(b) == s 2015-12-19 20:44:01 +02:00
Aliaksandr Valialkin f520ed8177 Follow-up tests after the pull request #19: added missing tests 2015-12-16 20:00:17 +02:00
Aliaksandr Valialkin 7e906e240d Made TestClientFollowRedirects more robust by adding timeout on Get 2015-11-30 20:39:54 +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 0b2690febe Added GetTimeout method to client 2015-11-25 13:45:34 +02:00
Aliaksandr Valialkin 48c0f89ee7 Added Stringer implementations to URI, Args and Cookie 2015-11-19 12:51:34 +02:00
Aliaksandr Valialkin 5c3b0287db API simplification: SetResponseBody -> SetBody 2015-11-18 13:33:29 +02:00
Aliaksandr Valialkin f1f78f0828 Hide Request.URI and Request.PostArgs behind accessors, which automatically call parse URI and PostArgs on first access 2015-11-15 23:47:22 +02:00
Aliaksandr Valialkin 8aef785c1e Added DoTimeout() to client 2015-11-14 23:18:52 +02:00
Aliaksandr Valialkin 1f531237c2 allow nil response in Do() and nil Args in Post() 2015-11-14 22:16:05 +02:00
Aliaksandr Valialkin 734c1a311b Retry idempotent requests on failure 2015-11-14 20:09:49 +02:00
Aliaksandr Valialkin f8bfa12215 Added Post() method to client 2015-11-13 16:13:22 +02:00
Aliaksandr Valialkin 25eefed74c Test concurrent access to http and https servers 2015-11-13 13:51:21 +02:00
Aliaksandr Valialkin b81ce4977b Added https support to client 2015-11-12 21:42:16 +02:00
Aliaksandr Valialkin e7ed62d38f Added client test for multi-server setup 2015-11-12 20:32:00 +02:00
Aliaksandr Valialkin af69d3830f Added initial tests for Client 2015-11-12 20:23:57 +02:00
Aliaksandr Valialkin ad3c1b72d8 Added basic tests for HostClient 2015-11-12 20:09:21 +02:00
Aliaksandr Valialkin d30241c539 Added Get() to http client 2015-11-11 20:00:08 +02:00
Aliaksandr Valialkin 6bb8d1108f Initial implementation of http client 2015-11-11 19:17:51 +02:00