Commit Graph

468 Commits

Author SHA1 Message Date
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 3222ab8c8c Added AppendIPv4 and ParseIPv4 helper functions 2015-12-11 13:11:15 +02:00
Aliaksandr Valialkin 752f493324 Refer to PathRewriteFunc as net/http.StripPrefix substitution 2015-12-10 13:26:46 +02:00
Aliaksandr Valialkin 400114e9fe Added RequestCtx.NotFound() helper 2015-12-10 13:22:23 +02:00
Aliaksandr Valialkin 6db1946298 Use ctx.UserAgent() shortcut instead of ctx.Request.Header.UserAgent() 2015-12-10 13:17:21 +02:00
Aliaksandr Valialkin 180e104034 Fixed misleading comments in workerpool 2015-12-10 12:05:36 +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 34c825a772 Set response content-length before writing response header 2015-12-10 08:43:49 +02:00
Aliaksandr Valialkin 22a408b7fb fs: decrement readers count if the file wasn't modified 2015-12-10 08:41:08 +02:00
Aliaksandr Valialkin ed8d883146 Ignore .pprof files 2015-12-10 08:39:12 +02:00
Aliaksandr Valialkin ebf9968b68 Renamed fshandler to fs 2015-12-09 18:52:23 +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 e0225d4c98 typo fix 2015-12-09 16:36:16 +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 37c8e563a1 Ignore built binaries from examples 2015-12-09 14:13:23 +02:00
Aliaksandr Valialkin f94e6ce77e Eliminated data race with readersCount 2015-12-09 14:02:09 +02:00
Aliaksandr Valialkin 2763d42da1 Renamed fshandler.go to fs.go 2015-12-09 14:01:39 +02:00
Aliaksandr Valialkin 4838a1852e Updated tips and tricks section in README 2015-12-09 13:54:41 +02:00
Aliaksandr Valialkin 5f157c097e Added UserAgent helper to RequestCtx 2015-12-09 13:48:33 +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 a482b7d35c Updated TODO 2015-12-08 15:22:17 +02:00
Aliaksandr Valialkin 42802cc79f Spelling fix 2015-12-08 15:21:09 +02:00
Aliaksandr Valialkin 9bac0d4123 Added RequestCtx.SendFile() 2015-12-08 15:18:21 +02:00
Aliaksandr Valialkin f244147c4f removed obsolete comment 2015-12-08 14:12:20 +02:00
Aliaksandr Valialkin d383fca082 Made Dial and DialFunc more visible in the documentation 2015-12-08 13:40:27 +02:00
Aliaksandr Valialkin a96f8ea43c Added FS struct, which may be used for fine grained setup of request handler for serving static files from local file system 2015-12-08 13:34:41 +02:00
Aliaksandr Valialkin 59316df4e0 Added HelloWorld server example 2015-12-08 12:18:54 +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
Aliaksandr Valialkin 1e4e9fe9e6 Trigger sendfile for response body stream wrapped into io.LimitedReader 2015-12-08 11:30:01 +02:00
Aliaksandr Valialkin b6c230a0fb Moved the hack for triggering sendfile in bufio.ReadFrom from FSHandler to Response.Write, so all response body streams may benefit from sendfile optimization 2015-12-08 10:47:50 +02:00
Aliaksandr Valialkin 5c8ab236b8 typo fix 2015-12-08 10:45:16 +02:00
Aliaksandr Valialkin 3072afc5e7 Returned back io.LimitedReader wrapper for writing response body streams 2015-12-08 10:44:20 +02:00
Aliaksandr Valialkin c1f7d2b1f0 Properly close response body stream 2015-12-08 10:27:37 +02:00
Aliaksandr Valialkin 0ac2d5f35e Removed DialTLS*, since it must be handled by client code 2015-12-07 16:44:14 +02:00
Aliaksandr Valialkin f2bf78799c typo fix 2015-12-07 16:36:15 +02:00
Aliaksandr Valialkin 019996b9ea Added ListenAndServeUNIX 2015-12-07 16:30:14 +02:00
Aliaksandr Valialkin 9c70042061 Exported default TCP dialers used by clients, so custom wrappers may be implemented around these dialers 2015-12-07 16:12:28 +02:00
Aliaksandr Valialkin 117487611a gofmt 2015-12-07 15:49:36 +02:00
Aliaksandr Valialkin 32022e42d0 Documentation fix for Do() 2015-12-07 13:55:59 +02:00
Aliaksandr Valialkin a3044a5fd8 Increased small file size threshold in FSHandler - 4-8Kb files are served faster with smallFileReader 2015-12-07 13:55:09 +02:00
Aliaksandr Valialkin 6794c894d9 Properly handle 'big file handler cannot be opened' error 2015-12-07 12:20:26 +02:00
Aliaksandr Valialkin 53d602ef50 Do not take into account data buffered in bufio.Writer when calculating the amount of data sent to the writer 2015-12-07 12:13:19 +02:00
Aliaksandr Valialkin a2ad246047 Fixed a typo 2015-12-07 12:10:22 +02:00
Aliaksandr Valialkin 778f4a1054 An attempt to trigger sendfile path in FSHandler when sending big files 2015-12-07 12:06:39 +02:00
Aliaksandr Valialkin 464f61fb44 FSHandler index page: fixed urls to files 2015-12-07 09:58:01 +02:00
Aliaksandr Valialkin b6349bb92a FSHandler index page: do not wrap file info into a link 2015-12-07 09:54:13 +02:00