Commit Graph

153 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 8a42c802f5 Optimized Peek() function for args and request header cookies 2015-11-14 20:38:47 +02:00
Aliaksandr Valialkin 91f896309a Added benchmark for Args.Peek() 2015-11-14 20:36:33 +02:00
Aliaksandr Valialkin 619385a506 Updated TODO 2015-11-14 20:19:07 +02:00
Aliaksandr Valialkin 734c1a311b Retry idempotent requests on failure 2015-11-14 20:09:49 +02:00
Aliaksandr Valialkin c01be3ee99 Panic if net.Listener returns (nil, nil) 2015-11-14 20:09:15 +02:00
Aliaksandr Valialkin 88e41d9b08 Removed accessors converting []byte to string, i.e. allocating memory. This should reduce memory usage for apps using fasthttp, since now they shoud either use []byte or do string() conversion on their own :) 2015-11-14 18:25:00 +02:00
Aliaksandr Valialkin 2e78d83bf7 Hide Request.RequestURI behind accessors in order to prevent users shooting in the foot when assigning to Request.RequestURI directly 2015-11-14 17:58:58 +02:00
Aliaksandr Valialkin 1f81c87c38 Substituted direct access to Request.Method by accessors, so package users don't shoot in the foot when assigning directly to Request.Method 2015-11-14 17:34:12 +02:00
Aliaksandr Valialkin 5eb991ed31 Added Concurrency parameter to Server 2015-11-14 14:54:45 +02:00
Aliaksandr Valialkin 081a395cb3 Added helper functions to RequestHeader and ResponseHeader for fast access to the most frequently used header values 2015-11-14 13:02:41 +02:00
Aliaksandr Valialkin 982edd5a7f Treat all errors on first header byte read as EOF. This eliminates numerous and useless 'connection reset by peer' log messages for keep-alive connections on busy server 2015-11-14 12:39:51 +02:00
Aliaksandr Valialkin bbcdceaa76 Added benchmark for net/http client with fake fast server 2015-11-13 19:50:31 +02:00
Aliaksandr Valialkin 69f3c67fce Added benchmark for measuring the maximum client throughput 2015-11-13 19:38:46 +02:00
Aliaksandr Valialkin 6edf440c99 Added SetRequestURI* helpers to Request 2015-11-13 19:33:28 +02:00
Aliaksandr Valialkin be5a9ddeaf Added helper functions to RequestCtx 2015-11-13 19:32:33 +02:00
Aliaksandr Valialkin b6c8cea99b Mention that client never sets BodyStream on response 2015-11-13 17:58:08 +02:00
Aliaksandr Valialkin af2218ffaf Add optional Dial callback and TLSConfig to Client 2015-11-13 17:55:54 +02:00
Aliaksandr Valialkin 8a44f0c563 Added end-to-end benchmarks for fasthttp and net/http 2015-11-13 16:56:16 +02:00
Aliaksandr Valialkin 3648ae63f7 Optimized updating lastUseTime 2015-11-13 16:43:55 +02:00
Aliaksandr Valialkin f8bfa12215 Added Post() method to client 2015-11-13 16:13:22 +02:00
Aliaksandr Valialkin 48fd01e5e0 Empty request method is equivalent to GET 2015-11-13 16:12:58 +02:00
Aliaksandr Valialkin 1bbce02863 Added IsGet(), IsPost() and IsHead() helpers to RequestCtx 2015-11-13 16:10:22 +02:00
Aliaksandr Valialkin fd177d7f63 Added global Serve* helpers 2015-11-13 15:08:22 +02:00
Aliaksandr Valialkin 25eefed74c Test concurrent access to http and https servers 2015-11-13 13:51:21 +02:00
Aliaksandr Valialkin f1e8e6bf25 Added support for identity responses. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 for details 2015-11-13 13:33:32 +02:00
Aliaksandr Valialkin 16632cbaa4 Set ConnectionClose for non-http/1.1 requests/responses. Do not support Connection: keep-alive for http/1.0 intentionally, since it will complicate the code without measurable benefits 2015-11-13 12:27:47 +02:00
Aliaksandr Valialkin 15cd28e255 do not update HostClient.MaxConns 2015-11-13 11:57:39 +02:00
Aliaksandr Valialkin 51135320b2 Update ContentLength in header after request/response body has been read 2015-11-13 11:53:44 +02:00
Aliaksandr Valialkin efbdc8fa7f Added ListenAndServe and ListenAndServeTLS helper functions to Server 2015-11-12 23:21:46 +02:00
Aliaksandr Valialkin 2cb5ae6a34 Added missing snakeoil ssl certificates for client tests 2015-11-12 21:51:14 +02:00
Aliaksandr Valialkin 3f0794bcd1 Added RequestCtx.LocalAddr() for determining server address for the current connection 2015-11-12 21:50:44 +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 aba783b596 Return nil from Server.Serve*() on expected errors such as io.EOF aond errConnClosing 2015-11-12 20:07:21 +02:00
Aliaksandr Valialkin 33c0dd1fe2 Do not log 'use of closed network connection' error when closing listener in Server.Serve* 2015-11-12 19:53:17 +02:00
Aliaksandr Valialkin 039f2d074e Added support for request's 'Connection: close' header into http client 2015-11-12 19:16:32 +02:00
Aliaksandr Valialkin 6bd9b01126 Added support for 'connection: close' request header 2015-11-12 18:54:15 +02:00
Aliaksandr Valialkin 0ba628eacc Document how server to be requested is determined by client 2015-11-12 14:57:27 +02:00
Aliaksandr Valialkin 5dd815b3d8 Added ability to set client name (aka User-Agent) 2015-11-12 14:37:09 +02:00
Aliaksandr Valialkin f8ae53ae49 Allow whitespaces in request uri, since certain stupid http clients do not bother escaping request uri :) 2015-11-12 14:14:30 +02:00
Aliaksandr Valialkin 6e4b32182e Fixed panic when WorkerFunc returns error and Conn is closed 2015-11-12 14:01:04 +02:00
Aliaksandr Valialkin 86115595ab Allow setting body length for Response.BodyStream via ResponseHeader.ContentLength 2015-11-12 13:30:27 +02:00
Aliaksandr Valialkin d30241c539 Added Get() to http client 2015-11-11 20:00:08 +02:00
Aliaksandr Valialkin 07e319a14f Move request validation and preparation down the stack to HostClient 2015-11-11 19:34:42 +02:00
Aliaksandr Valialkin 6bb8d1108f Initial implementation of http client 2015-11-11 19:17:51 +02:00
Aliaksandr Valialkin 5460e53c17 Subsitute empty RequestURI with slash 2015-11-11 19:15:54 +02:00
Aliaksandr Valialkin f4223fbb70 Added missing unlock when stopping worker pool 2015-11-11 18:08:15 +02:00
Aliaksandr Valialkin 2ae796311b Cleanup: removed dubious and hard-to-use-properly ReadTimeout from Request and Response. Use SetReadDeadline on the underlying conn instead 2015-11-11 16:52:32 +02:00