Commit Graph

173 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 68c6a4f496 Added ServeFileBytes* and RequestCtx.SendFileBytes* helper functions 2016-02-29 14:42:55 +02:00
Aliaksandr Valialkin dd6954f4b2 Issue #57: Server: added ability to disable header names' normalizing 2016-02-25 14:00:04 +02:00
Aliaksandr Valialkin 108d002365 Added tests for Server.ReduceMemoryUsage flag 2016-02-24 15:45:56 +02:00
Aliaksandr Valialkin f3dd0534ae Clarified documentation for Server configs 2016-02-23 11:28:48 +02:00
Aliaksandr Valialkin 115b98672e Make sure that the server always closes connection after HTTP/1.0 request without 'Connection: keep-alive' header 2016-02-22 23:00:36 +02:00
Aliaksandr Valialkin a3e1aeb8b6 eliminated memory allocation in RequestCtx.Redirect* 2016-02-19 17:20:27 +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 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 ace291546f Document that Server.ReadBufferSize may be increased for serving big requests 2016-02-18 12:46:37 +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 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 87628147e5 Use zero-alloc copy instead of io.Copy 2016-02-13 11:01:18 +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 eafcb74ce5 Call Close on user values stored via RequestCtx.SetUserValue if these values implement io.Closer 2016-02-05 12:50:58 +02:00
Aliaksandr Valialkin 2b4309d53d Added global ServeTLS function to be consistent with Server.ServeTLS 2016-02-03 16:21:42 +02:00
Aliaksandr Valialkin 85122869cf Removed misleading comment on ServeConn related to Hijack - this implementation detail is irrelevant to ServeConn caller 2016-01-28 11:21:20 +02:00
Aliaksandr Valialkin ee9a3ee319 Server: make sure that net.Listener returns nil conn on non-nil error 2016-01-27 17:21:38 +02:00
Aliaksandr Valialkin 52ddf98cfd Fixed golint warnings 2016-01-19 12:43:23 +02:00
Aliaksandr Valialkin 764a74e2ec Added ServeFile and ServeFileUncompressed to be on par with net/http 2016-01-17 23:12:38 +02:00
Aliaksandr Valialkin 81b5321d14 Removed misleading ConnectionCloseReal method from RequestHeader 2016-01-17 00:43:34 +02:00
Aliaksandr Valialkin 3e5866274d use Request.ConnectionClose instead of Request.Header.ConnectionClose 2016-01-13 13:41:47 +02:00
Aliaksandr Valialkin b6594defaa Added TLSConnectionState function to RequestCtx for verifying client certificates 2016-01-11 19:05:09 +02:00
Aliaksandr Valialkin 81ebe4ca8f Return clearer error when TLS certFile and/or keyFile cannot be loaded 2016-01-08 17:40:05 +02:00
Aliaksandr Valialkin 37931cad28 Added ServeTLS helper to Server 2016-01-08 17:31:59 +02:00
Aliaksandr Valialkin 910e5a9d2a Added FormFile and FormValue helpers to RequestCtx in order to be on par with net/http 2016-01-08 15:03:02 +02:00
Aliaksandr Valialkin c5d9023043 Issue #30: properly handle content-length for HEAD responses 2016-01-05 18:02:50 +02:00
Aliaksandr Valialkin 7f5b710e05 Issue #31: do not send response body for HEAD requests 2016-01-05 16:53:38 +02:00
Aliaksandr Valialkin 5a483a7e5d Added a notice that TimeoutError* functions may be used only as a last resort 2015-12-31 10:47:40 +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 c5b85a6124 Use default logger if logger passed to RequestCtx.Init() is nill 2015-12-29 11:14:47 +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 80105c1a85 Added RequestCtx.WriteString 2015-12-24 20:48:05 +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 5379f55d86 Pull request #21: updated docs 2015-12-20 15:51:13 +02:00
招牌疯子 abc35a8dc2 Redirect 307 instead of 302 2015-12-20 12:32:45 +08:00
Aliaksandr Valialkin 38473d3cf1 Issue #20: Added TimeoutErrorWithResponse helper function to RequestCtx 2015-12-17 12:25:53 +02:00
Aliaksandr Valialkin 3ab54e2452 Issue #20: Added TimeoutErrorWithCode helper function to RequestCtx 2015-12-16 21:13:59 +02:00
Aliaksandr Valialkin b00a213a93 Moved ctx.UserValue from standard map to custom userData. This should improve its' performance for common case when ctx contains up to 10 user values 2015-12-11 16:40:55 +02:00
Aliaksandr Valialkin 400114e9fe Added RequestCtx.NotFound() helper 2015-12-10 13:22:23 +02:00
Aliaksandr Valialkin 1f36aa1f8f clarify on why 'Connection: close' response header is set only for non-http/1.1 requests 2015-12-10 11:56:23 +02:00
Aliaksandr Valialkin 71e8c28a95 Issue #16: properly set 'Connection' response header 2015-12-10 11:47:25 +02:00
Aliaksandr Valialkin 495e130b8f Issue #16: support 'Connection: keep-alive' header for non-http/1.1 requests and/or responses 2015-12-10 11:19:34 +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 5f157c097e Added UserAgent helper to RequestCtx 2015-12-09 13:48:33 +02:00