Commit Graph

121 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 8581513fa2 Issue #61: server: properly read multipart/form-data 2016-03-01 18:07:52 +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 70316d0535 Issue #60: give up to find an optimal strategy for body buffers' re-use 2016-02-29 18:35:15 +02:00
Aliaksandr Valialkin 8985a565b2 Issue #60: throughput tuning: re-use body buffers if their size is smaller than 8Kb 2016-02-29 18:11:17 +02:00
Aliaksandr Valialkin fcfda9f312 Issue #60: increased client and server throughput when working with big bodies 2016-02-29 17:31:47 +02:00
Aliaksandr Valialkin c1437a71e6 Shuffled Request and Response members in order to reduce object sizes 2016-02-25 13:57:21 +02:00
Aliaksandr Valialkin f3d9e7ae9b golint fix 2016-02-25 13:30:25 +02:00
Sebastian Schepens 889c65bae6 Added BodyInflate and WriteInflate to match BodyGunzip and WriteGunzip 2016-02-22 14:36:58 -03:00
Aliaksandr Valialkin b98beaa40f Added RequestURI helper to Request 2016-02-21 13:22:13 +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 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 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 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 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 e7e436064f Keep response and request body after calling Body() if SetBodyStream is called 2016-02-13 11:42:22 +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 1ee286887c Substituted bytes.Buffer with ByteBuffer in marshalMultipartForm 2016-02-12 14:00:26 +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 6cd79f25f2 Added BodyWriteTo to Request and Response 2016-02-09 20:04:46 +02:00
Aliaksandr Valialkin 52d4b7ca38 Issue #15: document that io.EOF is returned from Read* calls on (Request|Response)(Header)? only if the reader is closed before the first byte read 2016-02-05 13:14:36 +02:00
Aliaksandr Valialkin f8c0d95e57 Issue #40: added io.WriterTo implementation to Request and Response 2016-01-21 12:24:51 +02:00
Aliaksandr Valialkin 52ddf98cfd Fixed golint warnings 2016-01-19 12:43:23 +02:00
Aliaksandr Valialkin a208149ac4 FS optimization: do not read file contents on HEAD requests 2016-01-18 20:40:43 +02:00
Aliaksandr Valialkin 7320fe3bd7 Properly update Request.URI() after Request.SetRequestURI() call 2016-01-17 23:09:11 +02:00
Aliaksandr Valialkin 86ae7f9eb2 Allow parsing post args for non-POST requests (for instance, for PUT requests) 2016-01-08 14:31:49 +02:00
Aliaksandr Valialkin 7d7c17c8d7 Do not send response body (and content-length) for 1xx, 204 and 304 responses 2016-01-06 15:22:52 +02:00
Aliaksandr Valialkin c5d9023043 Issue #30: properly handle content-length for HEAD responses 2016-01-05 18:02:50 +02:00
Aliaksandr Valialkin dbe26b3541 Do not set Content-Length in GET and HEAD requests according to pull request #31 (thanks to @buaazp ) 2016-01-05 15:47:30 +02:00
Aliaksandr Valialkin fc2dc7b3f1 Added WriteMultipartForm helper 2016-01-05 14:12:23 +02:00
Aliaksandr Valialkin c5f2e08130 Transparently gunzip multipart form data on Request.MultipartForm() call according to @celer suggestion 2016-01-04 15:12:30 +02:00
Aliaksandr Valialkin f704d819f6 Always return multipart form body on Request.Body() call 2015-12-31 15:38:34 +02:00
Aliaksandr Valialkin 85ae42bdba Do not read request body if both 'Content-Length' and 'Transfer-Encoding' headers are missing. Based on @celer's patch at https://github.com/celer/fasthttp/commit/667a8905cc6a95f223b5bd41056b1ea2861118df 2015-12-31 11:12:41 +02:00
Aliaksandr Valialkin 22c2acbb9d Optimization: reuse gzip/flate readers and writers. This should improve response body compression/decompression performance a bit 2015-12-28 18:58:05 +02:00
Aliaksandr Valialkin 3284c3e671 Pull request #24: added support for '100 Continue' responses and 'Expect: 100-continue' requests. Kudos to @celer 2015-12-25 16:11:20 +02:00
Aliaksandr Valialkin 149f0f38b7 Issue #14: added CompressHandler wrapper for transparent response compression support 2015-12-25 13:33:01 +02:00
Aliaksandr Valialkin edcfdbcec9 Issue #14: added support for response body compression 2015-12-25 12:26:34 +02:00
Aliaksandr Valialkin 80105c1a85 Added RequestCtx.WriteString 2015-12-24 20:48:05 +02:00
Aliaksandr Valialkin 5ff6be8fee Substitute AppendBytesStr by append() 2015-12-19 20:38:10 +02:00
Aliaksandr Valialkin 34c825a772 Set response content-length before writing response header 2015-12-10 08:43:49 +02:00
Aliaksandr Valialkin 9c18f79145 Added support for If-Modified-Since to SendFile and FS 2015-12-09 18:51:51 +02:00
Aliaksandr Valialkin 1a06baebe3 Refer to SetBodyStreamWriter from SetBodyStream docs 2015-12-09 16:34:50 +02:00
Aliaksandr Valialkin 52999aff94 Added SetBodyStreamWriter for streaming response body 2015-12-09 16:33:07 +02:00
Aliaksandr Valialkin 6ad39dad61 Added SendFile to Response 2015-12-09 13:47:11 +02:00
Aliaksandr Valialkin bc50b11813 Added AppendBody and SetBodyString helper methods to Request and Response 2015-12-09 13:43:06 +02:00
Aliaksandr Valialkin ff63733774 Removed LimitedReader wrapper in writeBodyFixedSize, since it prevents sendfile triggering for FSHandler 2015-12-08 11:50:04 +02:00