Commit Graph

707 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 4a29aeb2bd Added tests for HTTP/1.0 requests regarding 'Connection: close' handling 2016-02-22 18:18:50 +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 b98beaa40f Added RequestURI helper to Request 2016-02-21 13:22:13 +02:00
Aliaksandr Valialkin 58e4dea85d Properly copy query arguments in URI.CopyTo 2016-02-19 20:17:37 +02:00
Aliaksandr Valialkin be49d3027a Allow updating request's RequestURI and Host header via Request.URI() 2016-02-19 18:53:13 +02:00
Aliaksandr Valialkin 0ab0d45a50 Eliminated two memory allocations when client follows redirect 2016-02-19 17:27:47 +02:00
Aliaksandr Valialkin a3e1aeb8b6 eliminated memory allocation in RequestCtx.Redirect* 2016-02-19 17:20:27 +02:00
Aliaksandr Valialkin 6489c32a90 Added AcquireCookie / ReleaseCookie helpers 2016-02-19 13:03:35 +02:00
Aliaksandr Valialkin 5a26dcce53 Added AcquireArgs and ReleaseArgs helper functions 2016-02-19 12:53:39 +02:00
Aliaksandr Valialkin ed7ca4c631 Added LogAllErrors config parameter to Server, which allows logging the most frequent errors such as 'connection reset by peer', 'broken pipe' and 'i/o timeout'. By default such errors are suppressed 2016-02-19 12:01:27 +02:00
Aliaksandr Valialkin 14b2ff3d2b Issue #14: Added BodyGunzip helper method to Request to be consistent with Response 2016-02-18 17:01:05 +02:00
Aliaksandr Valialkin d7f433999f Document that it is safe re-using []byte buffers after SetBody and AppendBody function calls 2016-02-18 16:49:23 +02:00
Aliaksandr Valialkin d95ef5ab6c Added a test for bufferStartEnd 2016-02-18 16:21:04 +02:00
Aliaksandr Valialkin 714b45e4c7 Print only the first 200 and the last 200 bytes of the buffer on error during headers' reading 2016-02-18 15:57:34 +02:00
Aliaksandr Valialkin 320182f734 Return more clear error message when headers don't fit read buffer size 2016-02-18 15:33:30 +02:00
Aliaksandr Valialkin 72ca29fa75 Use go 1.6 in travis 2016-02-18 14:19:26 +02:00
Aliaksandr Valialkin ace291546f Document that Server.ReadBufferSize may be increased for serving big requests 2016-02-18 12:46:37 +02:00
Aliaksandr Valialkin 7cde0cf1fa Reduce memory waste and fragmentation by limiting the maximum request and response body size which may be re-used 2016-02-18 12:23:11 +02:00
Aliaksandr Valialkin e1488d9349 Consistency fix: refer to URI as u instead of x in URI methods 2016-02-17 12:15:48 +02:00
Aliaksandr Valialkin dcd687ba8b Added AcquireURI and ReleaseURI 2016-02-17 12:10:53 +02:00
Aliaksandr Valialkin fd2887a5fc Issue #53: Clarify that the following instances mustn't be used from concurrently running goroutines: Args, Cookie, URI, RequestCtx, Request, Response, RequestHeader and ResponseHeader 2016-02-17 11:45:21 +02:00
Aliaksandr Valialkin 9f608dd1fd Issue #51: Make RequestCtx.SendFile a synonim to ServeFile. This breaks RequestCtx.SendFile API, but I believe the new behaviour of SendFile outweights API breakage 2016-02-17 11:35:36 +02:00
Aliaksandr Valialkin 445fb8a9ae header: skip trailing CRLFs after request/response bodies 2016-02-16 19:37:51 +02:00
Aliaksandr Valialkin 394c20fdc5 Added AppendHTMLEscape helper function 2016-02-15 16:53:44 +02:00
Aliaksandr Valialkin 44ffec0954 Issue #52: updated client benchmark results in readme 2016-02-15 15:00:33 +02:00
Aliaksandr Valialkin db0b8124a5 Added Args.PeekMulti for obtaining multiple query arg values for the given key 2016-02-15 14:01:22 +02:00
Aliaksandr Valialkin 83e1796359 Do not copy body stream in Request.CopyTo to be consistent with Response.CopyTo 2016-02-14 14:38:00 +02:00
Aliaksandr Valialkin a8c4ad4d10 document that WriteGzip* and WriteDeflate* methods on Response compress Response.Body() before writing it to output stream 2016-02-14 14:33:19 +02:00
Aliaksandr Valialkin c53eccc930 always close body stream after writing request/response 2016-02-14 14:18:49 +02:00
Aliaksandr Valialkin eba076e4d3 Server: call Request.Reset immediately after RequestHandler returns 2016-02-14 14:17:03 +02:00
Aliaksandr Valialkin 03ec1a0d63 Server: call Response.Reset after writing response to client 2016-02-14 13:55:09 +02:00
Aliaksandr Valialkin e1c20b5b8f Test Close on NewStreamReader 2016-02-13 12:43:14 +02:00
Aliaksandr Valialkin e7e436064f Keep response and request body after calling Body() if SetBodyStream is called 2016-02-13 11:42:22 +02:00
Aliaksandr Valialkin cd2eb9bd90 Document that Close must be called on the reader returned from NewStreamReader 2016-02-13 11:07:39 +02:00
Aliaksandr Valialkin 87628147e5 Use zero-alloc copy instead of io.Copy 2016-02-13 11:01:18 +02:00
Aliaksandr Valialkin 77a12cbf68 Added SetBodyStream* to Request. This allows streaming multi-GB data in request bodies 2016-02-12 20:52:29 +02:00
Aliaksandr Valialkin dde91b5c5b Explicitly state that the hijacked connection cannot be used after returning from HijackHandler 2016-02-12 19:29:35 +02:00
Aliaksandr Valialkin 9c9b5abffa Documentation update according to golint 2016-02-12 17:47:57 +02:00
Aliaksandr Valialkin bfce0fa31c substituted bytes.Buffer by ByteBuffer in tests where appropriate 2016-02-12 14:15:28 +02:00
Aliaksandr Valialkin 80368e6491 Switch from bytes.Buffer to ByteBuffer where appropriate 2016-02-12 14:07:56 +02:00
Aliaksandr Valialkin 1ee286887c Substituted bytes.Buffer with ByteBuffer in marshalMultipartForm 2016-02-12 14:00:26 +02:00
Aliaksandr Valialkin b7df433642 Added benchmarks for bytes.Buffer vs ByteBuffer comparison 2016-02-12 13:56:41 +02:00
Aliaksandr Valialkin 00f18757ec Added Reset method to ByteBuffer 2016-02-12 13:56:07 +02:00
Aliaksandr Valialkin dd96137a25 Substitute bytes.Buffer with ByteBuffer when compressing response body and converting request and response to string. This shaves off one memory allocation 2016-02-11 20:03:15 +02:00
Aliaksandr Valialkin 6210374fa8 Implement io.Writer in ByteBuffer and use it instead of bytes.Buffer in isFileCompressible 2016-02-11 19:36:43 +02:00
Aliaksandr Valialkin 0aec76fa1f code cleanup 2016-02-11 19:32:38 +02:00
Aliaksandr Valialkin 6b0853e13b Mention fasthttpadaptor and expvarhandler in README 2016-02-11 12:17:44 +02:00
Aliaksandr Valialkin d988b3ebab typo fix 2016-02-11 12:14:29 +02:00
Aliaksandr Valialkin 8757b644eb Exported ByteBuffer 2016-02-11 12:12:37 +02:00
Aliaksandr Valialkin bb2a414fe8 Issues #14, #46: use @klauspost 's compress library instead of standard compress/*, since it provides better performance on average 2016-02-10 16:40:14 +02:00