Aliaksandr Valialkin
|
1c19e5f2c1
|
do not trim big body buffers - they should be handled by GC
|
2015-11-14 21:13:04 +02:00 |
|
Aliaksandr Valialkin
|
c01be3ee99
|
Panic if net.Listener returns (nil, nil)
|
2015-11-14 20:09:15 +02:00 |
|
Aliaksandr Valialkin
|
88e41d9b08
|
Removed accessors converting []byte to string, i.e. allocating memory. This should reduce memory usage for apps using fasthttp, since now they shoud either use []byte or do string() conversion on their own :)
|
2015-11-14 18:25:00 +02:00 |
|
Aliaksandr Valialkin
|
2e78d83bf7
|
Hide Request.RequestURI behind accessors in order to prevent users shooting in the foot when assigning to Request.RequestURI directly
|
2015-11-14 17:58:58 +02:00 |
|
Aliaksandr Valialkin
|
1f81c87c38
|
Substituted direct access to Request.Method by accessors, so package users don't shoot in the foot when assigning directly to Request.Method
|
2015-11-14 17:34:12 +02:00 |
|
Aliaksandr Valialkin
|
5eb991ed31
|
Added Concurrency parameter to Server
|
2015-11-14 14:54:45 +02:00 |
|
Aliaksandr Valialkin
|
be5a9ddeaf
|
Added helper functions to RequestCtx
|
2015-11-13 19:32:33 +02:00 |
|
Aliaksandr Valialkin
|
1bbce02863
|
Added IsGet(), IsPost() and IsHead() helpers to RequestCtx
|
2015-11-13 16:10:22 +02:00 |
|
Aliaksandr Valialkin
|
fd177d7f63
|
Added global Serve* helpers
|
2015-11-13 15:08:22 +02:00 |
|
Aliaksandr Valialkin
|
efbdc8fa7f
|
Added ListenAndServe and ListenAndServeTLS helper functions to Server
|
2015-11-12 23:21:46 +02:00 |
|
Aliaksandr Valialkin
|
3f0794bcd1
|
Added RequestCtx.LocalAddr() for determining server address for the current connection
|
2015-11-12 21:50:44 +02:00 |
|
Aliaksandr Valialkin
|
aba783b596
|
Return nil from Server.Serve*() on expected errors such as io.EOF aond errConnClosing
|
2015-11-12 20:07:21 +02:00 |
|
Aliaksandr Valialkin
|
33c0dd1fe2
|
Do not log 'use of closed network connection' error when closing listener in Server.Serve*
|
2015-11-12 19:53:17 +02:00 |
|
Aliaksandr Valialkin
|
6bd9b01126
|
Added support for 'connection: close' request header
|
2015-11-12 18:54:15 +02:00 |
|
Aliaksandr Valialkin
|
6e4b32182e
|
Fixed panic when WorkerFunc returns error and Conn is closed
|
2015-11-12 14:01:04 +02:00 |
|
Aliaksandr Valialkin
|
a4e8e226ff
|
Removed dubious loop for obtaining free worker - just increase the number of workers if 'no free workers' error occur
|
2015-11-11 16:39:59 +02:00 |
|
Aliaksandr Valialkin
|
69758b81d6
|
Accept net.Conn instead of io.ReadWriteCloser in Serve*() methods, since in reality we use net.Conn methods such as RemoteAddr, SetReadDeadline and SetWriteDeadline
|
2015-11-11 16:17:12 +02:00 |
|
Aliaksandr Valialkin
|
ae6a7cc17c
|
Extracted workerPool from server.go into workerpool.go
|
2015-11-11 15:27:27 +02:00 |
|
Aliaksandr Valialkin
|
89e1feae77
|
Reference TimeoutHandler in RequestHandler docs
|
2015-11-11 11:42:17 +02:00 |
|
Aliaksandr Valialkin
|
0d0e179d7b
|
Added RequestCtx.SetResponseBody helper function
|
2015-11-11 11:09:31 +02:00 |
|
Aliaksandr Valialkin
|
ad3452a2e5
|
Removed dubious Cache from RequestCtx - use sync.Pool instead
|
2015-11-11 10:47:16 +02:00 |
|
Aliaksandr Valialkin
|
b6adf1cd39
|
Clean least recently used workers in a separate goroutine. This cleans stale workers even on idle server
|
2015-11-10 17:59:19 +02:00 |
|
Aliaksandr Valialkin
|
fa05bcd728
|
Server worker pool optimization - now incoming connections are served by workers in 'most recently used worker' order. This should keep CPU caches hot
|
2015-11-10 15:24:36 +02:00 |
|
Aliaksandr Valialkin
|
8081e14ca0
|
Use perIPConn pool
|
2015-11-10 15:20:13 +02:00 |
|
Aliaksandr Valialkin
|
e7b70f2c8a
|
Fixed doc typos
|
2015-11-10 12:46:36 +02:00 |
|
Aliaksandr Valialkin
|
a0ee798bbe
|
Added RequestCtx.Init() helper for custom Server implementations
|
2015-11-09 18:41:27 +02:00 |
|
Aliaksandr Valialkin
|
04b68cd1f5
|
Export DefaultConcurrency
|
2015-11-09 17:10:27 +02:00 |
|
Aliaksandr Valialkin
|
827b8b1e82
|
Added TimeoutErrMsg() function to RequestCtx for determining the last error message set via TimeoutError call
|
2015-11-09 17:06:50 +02:00 |
|
Aliaksandr Valialkin
|
3aa2987131
|
Substituted RequestCtx.shadow with more clear timeoutErrMsg
|
2015-11-09 11:03:50 +02:00 |
|
Aliaksandr Valialkin
|
e8bd4f1d82
|
Do not allocate memory for msg in RequestCtx.Error
|
2015-11-09 10:45:33 +02:00 |
|
Aliaksandr Valialkin
|
964f640cd1
|
gofmt
|
2015-11-09 10:43:17 +02:00 |
|
Aliaksandr Valialkin
|
9200e02eb5
|
Consistency fix: readersPool->readerPool, writersPool->writerPool
|
2015-11-09 10:42:09 +02:00 |
|
Aliaksandr Valialkin
|
e8ffadf2df
|
Moved currentTime variable ouside request processing loop
|
2015-11-07 11:09:41 +02:00 |
|
Aliaksandr Valialkin
|
03f8f2408e
|
Increment request id and initialize request time before request reading, so log messages contain correct id and duration for request read errors
|
2015-11-06 16:34:16 +02:00 |
|
Aliaksandr Valialkin
|
5a6e973ab3
|
Log request duration in RequextCtx.Logger()
|
2015-11-06 16:21:49 +02:00 |
|
Aliaksandr Valialkin
|
a7fdc68be0
|
Enforce MaxConnsPerIP limit to connections served via Server.ServeConn()
|
2015-11-05 10:56:04 +02:00 |
|
Aliaksandr Valialkin
|
552dff6fd6
|
Do no hold memory (read/write buffers+RequestCtx data) for idle keep-alive connections. This should reduce memory usage for 100K+ concurrent keep-alive connections to the server
|
2015-11-03 14:16:41 +02:00 |
|
Aliaksandr Valialkin
|
1429b48135
|
Remove reference to conn from buffered reader and writer when releasing RequestCtx. This should help GC a bit :)
|
2015-11-02 19:11:09 +02:00 |
|
Aliaksandr Valialkin
|
fb362174d7
|
initRequestCtx -> initCtx for the sake of consistency
|
2015-11-02 18:28:57 +02:00 |
|
Aliaksandr Valialkin
|
3eaecd9c6c
|
Added ability to limit the number of concurrent client connections per ip
|
2015-11-02 15:09:45 +02:00 |
|
Aliaksandr Valialkin
|
7c83bade48
|
Clear response before calling request handler
|
2015-10-30 12:10:27 +02:00 |
|
Aliaksandr Valialkin
|
7ba1898d05
|
Return net.Addr from RequestCtx.RemoteAddr() and net.IP from RequestCtx.RemoteIP() instead of strings
|
2015-10-27 19:02:11 +02:00 |
|
Aliaksandr Valialkin
|
664d577260
|
Added SetCanonical() methods to RequestHeader and ResponseHeader
|
2015-10-27 13:36:42 +02:00 |
|
Aliaksandr Valialkin
|
d70261286c
|
Added CopyTo, VisitAll and *Bytes* helper functions to Args, RequestHeader and ResponseHeader
|
2015-10-27 12:53:33 +02:00 |
|
Aliaksandr Valialkin
|
a1fca0f209
|
Fixed connection leak on pending connections queue overflow
|
2015-10-26 15:15:58 +02:00 |
|
Aliaksandr Valialkin
|
27862cc299
|
Fixed data races in Request.ReadTimeout() and Response.ReadTimeout(). Documented that the request and response instances cannot be used after ErrReadTimeout error
|
2015-10-26 14:13:33 +02:00 |
|
Aliaksandr Valialkin
|
d76f5c5aba
|
Log connection-related info on error
|
2015-10-23 19:38:16 +03:00 |
|
Aliaksandr Valialkin
|
40e775dce5
|
Added TimeoutHandler
|
2015-10-23 14:56:01 +03:00 |
|
Aliaksandr Valialkin
|
7874b9245a
|
Properly implement request read timeout via SetReadDeadline(). Implement response write timeout
|
2015-10-23 13:26:15 +03:00 |
|
Aliaksandr Valialkin
|
c842617b00
|
microoptimization: convert io.ReadWriter to remoteAddrer only before use
|
2015-10-23 13:01:09 +03:00 |
|