Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
gofmt -w -r "interface{} -> any" -l .
|
|
* add cache manager struce
* refactor cache by adding interface
* generalize ctor
* implement feature add unit tests
* fix code
* rename fs field as filesystem
|
|
|
|
|
|
|
|
|
|
* test: use T.TempDir instead of MkdirTemp
* Fix test by adding reader.ff.Release()
|
|
This reverts commit a468a7dd3734d9866ef6ab8ee1e36695f5c3b09c.
|
|
* feat: support mulit/range
* fix:
1. lint code
2. add SetByteRanges method
* fix: reduce the test number of testFSSingleByteRange
|
|
* Dropping support for 1.15.
* Replaces Go 1.16 Deprecated functions
* Update test build flag
* Fix import sort and comment
* Update github.com/klauspost/compress to v1.15.9
https://github.com/klauspost/compress improved performance and changed Minimum version is 1.16, this should be the final supported release for Go 1.16 (https://github.com/klauspost/compress/commit/6d0019a95afa3221f7522d1f2eed0033b5e79470) .
|
|
Header.SetCanonical() (#1311)
* Response.ContentEncoding(): store as field
The CE is not so often used for plain APIs responses and even not so often used for static files and on the fly compression.
But still it should be checked each time.
Also having a dedicated field getter and setter simplifies code
* header.go Use shorter Response.setNonSpecial() and Request.setNonSpecial() methods instead of SetCanonical()
The change should improve performance because the setSpecialHeader() call is omitted.
As a downside on adding a new basic header field all putHeader() must be replaced with a direct getter and setter.
|
|
Mostly in tests.
|
|
|
|
* Don't run all race tests on windows
It's too slow and gives a lot of false positives in our tests.
* No FS tests on windows
|
|
|
|
These tests all try to create the compressed versions of files at the
same time which might lead to concurrency errors.
|
|
* Fix various Windows Github Action errors
These tests keep giving errors because Windows Actions are slower.
* Remove some timeouts
We don't need timeouts in all tests, only in the ones where we are
actually testing timeout logic.
|
|
And TestFSCompressConcurrent timeout
|
|
|
|
* Allow stopping FS handler cleanup gorountine
* CleanStop
|
|
* Add files via upload
* Update fs.go
* Add files via upload
* Update fs_test.go
|
|
|
|
* Try TravisCI Windows
* prefork is supported on windows with Reuseport=true
* Bit longer timeouts for tests
|
|
* Make FS return a redirect for directories without trailing slash
Fixes #792
* Add a test for the directory redirect
* Fix directory redirects for ServeFile
* Fix error message
Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
|
|
|
|
|
|
- Some tests can't be run in parallel.
- `URI` had a pointer to `RequestHeader` which was updated with
`RequestHeader.CopyTo` which resulted in the URI pointing to the wrong
`RequestHeader` causing bugs and race conditions.
The only reason `URI` contained a pointer to `RequestHeader` was to delay the
call to `RequestHeader.Host()` until really needed. But these days instead
of parsing all headers, `RequestHeader.Host()` uses
`RequestHeader.peekRawHeader()` which is rather fast. So we can remove the
pointer in `URI` and completely decouple the two structs improving code
quality and fixing the bug.
For some reason this results in faster code on average as well:
benchmark old ns/op new ns/op delta
BenchmarkClientGetEndToEnd1Inmemory-8 1189 1369 +15.14%
BenchmarkClientGetEndToEnd10Inmemory-8 1143 1161 +1.57%
BenchmarkClientGetEndToEnd100Inmemory-8 1228 1236 +0.65%
BenchmarkClientGetEndToEnd1000Inmemory-8 1213 1213 +0.00%
BenchmarkClientGetEndToEnd10KInmemory-8 1362 1350 -0.88%
BenchmarkClientEndToEndBigResponse1Inmemory-8 139967 130070 -7.07%
BenchmarkClientEndToEndBigResponse10Inmemory-8 142233 131809 -7.33%
BenchmarkServerGet1ReqPerConn-8 1726 1593 -7.71%
BenchmarkServerGet2ReqPerConn-8 882 927 +5.10%
BenchmarkServerGet10ReqPerConn-8 440 436 -0.91%
BenchmarkServerGet10KReqPerConn-8 341 339 -0.59%
BenchmarkServerPost1ReqPerConn-8 1728 1706 -1.27%
BenchmarkServerPost2ReqPerConn-8 968 963 -0.52%
BenchmarkServerPost10ReqPerConn-8 506 505 -0.20%
BenchmarkServerPost10KReqPerConn-8 424 420 -0.94%
BenchmarkServerGet1ReqPerConn10KClients-8 1117 1051 -5.91%
BenchmarkServerGet2ReqPerConn10KClients-8 565 514 -9.03%
BenchmarkServerGet10ReqPerConn10KClients-8 390 387 -0.77%
BenchmarkServerGet100ReqPerConn10KClients-8 355 348 -1.97%
BenchmarkServerHijack-8 339 348 +2.65%
BenchmarkServerMaxConnsPerIP-8 326 325 -0.31%
BenchmarkServerTimeoutError-8 24355 24180 -0.72%
|
|
|
|
|
|
* :sparkles: Added methods constants
* :ok_hand: Fixed methods comment due to review changes
|
|
* all: use sort.Strings when applicable
Basically, sort.Strings is the shortcut of Sort(StringSlice(a)) but its
more readable.
* all: replace string(bytes.Buffer.Bytes()) with bytes.Buffer.String()
Although its only occured on test files, it may be worth to simplified it.
* http_test: simplify strings.Index with strings.Contains
Both have the same O(n), but strings.Contains more readable on
if-condition.
* args: simplify if-condition check on boolean value
* all: simplify variable initialization
If we assign the variable after declaring it, we can simplify it using
":=" operator or "= value".
The reader can still known the type of variable from the struct name or
variable type before assignment operator.
|
|
Fixes #417
|
|
See https://github.com/erikdubbelboer/fasthttp/pull/10
|
|
The bug raises when io.Writer passed to fsSmallFileReader.WriteTo
doesn't support ReadFrom interface.
|
|
FSHandlerCacheDuration documentation
|
|
|
|
2616
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|