Commit Graph

118 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 019996b9ea Added ListenAndServeUNIX 2015-12-07 16:30:14 +02:00
Aliaksandr Valialkin fab86ba9b4 Mention TimeoutError exception, which may be called when other goroutines access RequestCtx 2015-12-03 13:42:08 +02:00
Aliaksandr Valialkin 4ac44f0c6c Mention which structs are safe for use from concurrently running goroutines (Server, Client and HostClient) and which structs are unsafe to use from concurrently running goroutines - all the other 2015-12-03 13:38:59 +02:00
Aliaksandr Valialkin 0b6cc4cbad Issue #13: add a (k,v) storage inside RequestCtx for user values, which may pass between middlewares 2015-12-02 20:32:49 +02:00
Aliaksandr Valialkin 1ddca5dc04 Added ResetBody 2015-12-02 08:36:31 +02:00
Aliaksandr Valialkin 07a8bf90b4 Properly remove hijack hander from RequestCtx 2015-11-29 22:36:49 +02:00
Aliaksandr Valialkin 4cf82252e3 Added ability to filter out non-GET requests 2015-11-29 12:49:01 +02:00
Aliaksandr Valialkin fb07cbbd31 Signify that Request and Response from RequestCtx and Header from Request and Response mustn't be copied by value 2015-11-29 12:18:33 +02:00
Aliaksandr Valialkin 1364e4c206 Added IsPut to RequestCtx to be consistent with IsGet and IsPost 2015-11-29 11:37:05 +02:00
Aliaksandr Valialkin d8c882d360 scalability improvement: initialize RequestCtx.id only when creating new RequestCtx obect. This should reduce globalCtxID contention 2015-11-28 17:23:53 +02:00
Aliaksandr Valialkin a5a2571194 scalability improvement: make firstByteReader's pool per-server 2015-11-28 17:14:32 +02:00
Aliaksandr Valialkin 78f1cc863a hijack scalability improvement: make hijacked conn per-server 2015-11-28 17:12:01 +02:00
Aliaksandr Valialkin 8563a2e762 Follow redirects in client Get* and Post* methods. Added Redirect method to RequestCtx. 2015-11-28 14:47:19 +02:00
Aliaksandr Valialkin d7ecf59c5d Added Request.RemoveMultipartFormFiles for removing temporary files created during reading multipart/form-data request 2015-11-28 10:32:55 +02:00
Aliaksandr Valialkin cc79b27b51 Imporoved multipart/form-data support.
* The server automatically deletes temporary uploaded files after returning
  from RequestHandler.
* Multipart data is automatically streamed into temporary files on request
  reading. This limits memory usage for big file uploads.
2015-11-28 10:18:03 +02:00
Aliaksandr Valialkin 01031f43e2 Added support form multipart/form-data POST requests 2015-11-27 16:23:02 +02:00
Aliaksandr Valialkin df6fda8c33 Added ability to limit request body size on the server and response body size on the client 2015-11-27 13:22:15 +02:00
Aliaksandr Valialkin c695c83986 Added RequestCtx.IsTLS, which may be used for determining whether the connection is encrypted 2015-11-26 18:55:26 +02:00
Aliaksandr Valialkin 8b00288e0a Skip br.Buffered() verification, since it is guaranteed it is higher than 0 if br != nil 2015-11-26 12:22:24 +02:00
Aliaksandr Valialkin 9e35210a5a Fixed possible data race on RequestCtx.TimeoutError if connection's buffered reader is attached to ctx.fbr 2015-11-24 16:56:29 +02:00
Aliaksandr Valialkin 6a90e62dd3 Fixed data race when hijacked conn is backed by firstByteReader, which is attached to RequestCtx 2015-11-24 15:42:52 +02:00
Aliaksandr Valialkin 45ed911251 Improved RequestCtx.Hijack() - now HijackHandler works with the real net.Conn instead of fake io.ReadWriter. Also reduced memory usage by releasing empty read buffers on hijacked connections 2015-11-24 13:55:00 +02:00
Aliaksandr Valialkin 146145240d Added RequestCtx.Hijack() for connections' hijacking 2015-11-23 19:41:43 +02:00
Aliaksandr Valialkin 1fb0888104 Moved ErrKeepaliveTimeout to ServeConn errors section 2015-11-23 14:21:31 +02:00
Aliaksandr Valialkin a81d93c2ae Added ability to limit keep-alive connection lifetime 2015-11-23 14:17:49 +02:00
Aliaksandr Valialkin 70269b237a Clarified that ReduceMemoryUsage may be used when serving more than 1M concurrent mostly idle keep-alive connections 2015-11-23 13:14:57 +02:00
Aliaksandr Valialkin 49a2103c07 Clear ctx in Server.serveConn while waiting for the next request in acquireByteReader(). This should help GC collecting ctx objects 2015-11-23 12:18:53 +02:00
Aliaksandr Valialkin 351cfa1153 Added ReduceMemoryUsage option to Server 2015-11-22 14:39:41 +02:00
Aliaksandr Valialkin 46ac549ae1 Access URI members via accessors 2015-11-22 13:05:24 +02:00
Aliaksandr Valialkin a862d8592a Documentation update 2015-11-22 06:33:58 +02:00
Aliaksandr Valialkin 14fcfcd65b Properly track connection start time and per-connection request num 2015-11-22 04:34:26 +02:00
Aliaksandr Valialkin 6be8800950 Properly keep request start time in acquireByteReader 2015-11-22 04:11:37 +02:00
Aliaksandr Valialkin a8bfab03d8 API prettifying: ServeConnTime -> ConnTime, ServeConnRequestNum -> ConnRequestNum 2015-11-22 01:29:42 +02:00
Aliaksandr Valialkin 0109f3a8d6 Defer allocating RequestCtx if requests' frequency on keep-alive connection is less than 1 HZ (1 req/s). This reduces memory usage for servers with a million of concurrent connections with infrequent requests 2015-11-22 01:22:31 +02:00
Aliaksandr Valialkin 5af424687b Removed obsolete comment 2015-11-22 00:41:34 +02:00
Aliaksandr Valialkin 2b1eca3a70 Optimize request uri parsing - defer Host header reading 2015-11-19 15:05:27 +02:00
Aliaksandr Valialkin 954a0615dc Fixed a typo in RequestCtx.SetConnectionClose() 2015-11-19 11:51:04 +02:00
Aliaksandr Valialkin a2601c68af API consistency change - make Response.StatusCode accessor 2015-11-19 11:39:20 +02:00
Aliaksandr Valialkin 835bf87605 API consistency: Clear -> Reset to be consistent with standard go packages 2015-11-18 17:55:28 +02:00
Aliaksandr Valialkin 548333e1c4 Added Write() function to RequestCtx for populating response body 2015-11-18 14:20:39 +02:00
Aliaksandr Valialkin 86fe38c7a2 Hide Respone and Request body behind Body accessors 2015-11-18 14:00:24 +02:00
Aliaksandr Valialkin 3ee3da595e Added Response.SetStatusCode 2015-11-18 13:51:04 +02:00
Aliaksandr Valialkin 6d16259215 Added SetBody and SetBodyStream methods to Response and RequestCtx 2015-11-18 13:49:23 +02:00
Aliaksandr Valialkin 5c3b0287db API simplification: SetResponseBody -> SetBody 2015-11-18 13:33:29 +02:00
Aliaksandr Valialkin c9ec8e85e0 Added MaxrequestsPerConn limit to Server 2015-11-17 16:39:45 +02:00
Aliaksandr Valialkin f3b4ff17b1 Added accessors for determining ServeConn call start time and the sequence number of request served in the connection 2015-11-17 16:29:14 +02:00
Aliaksandr Valialkin 2eff1422af Added referer accessor to RequestHeader 2015-11-17 13:47:00 +02:00
Aliaksandr Valialkin 2499cde277 Added referer accessor to RequestCtx 2015-11-17 13:42:05 +02:00
Aliaksandr Valialkin 800fe1306b Server microoptimization: check response's 'connection: close' first 2015-11-17 11:38:25 +02:00
Aliaksandr Valialkin 0e2c4013f7 Added ID accessor to RequestCtx 2015-11-17 09:47:17 +02:00