Commit Graph

1901 Commits

Author SHA1 Message Date
zhaoxy 707bfb8c0e remove extra space 2018-11-23 12:40:08 +06:30
zhaoxy a26bbd1812 Remove the set read and write deadline optimization since golang has fixed it https://github.com/golang/go/issues/15133#issuecomment-271571395 2018-11-23 12:40:08 +06:30
zhaoxy 8a7123ed78 fix check failed 2018-11-23 12:40:08 +06:30
川宇 4570d12009 avoid empty pointer 2018-11-23 12:40:08 +06:30
川宇 c7d1f2a6d6 reset connection read and write deadline for reuse 2018-11-23 12:40:08 +06:30
Ciprian Dorin Craciun cd72109b02 Update server to not release read and write buffers if ReduceMemoryUsage is not set 2018-11-21 13:39:55 +06:30
Ciprian Dorin Craciun f9d5eea569 Add note about panic recovery for Server.Handler 2018-11-21 13:37:54 +06:30
Erik Dubbelboer 598a52272a No error response on keep-alive close
Don't return an error response if a keep-alive connection closes either
because the other side closed the connection or a read timeout occurs.

This will prevent net/http from printing
"Unsolicited response received on idle HTTP channel"
when a ReadTimeout is set on the fasthttp Server.

Fixes #465
2018-11-21 13:33:28 +06:30
Erik Dubbelboer 65955d6208 Don't reset headers when reading the body fails
Not doing this means people using Client can still inspect the response
headers when reading the body fails (for example when it is too big).

fixes #456
2018-11-16 00:24:33 +08:00
Erik Dubbelboer efe4585c98 Make RequestCtx implement context.Context
fixes #459
2018-11-16 00:22:29 +08:00
dgrr e9eca1e4a0 noCopy didn't implement sync.Locker well. L letter of Unlock must be lower case 2018-11-14 07:33:18 +05:30
Erik Dubbelboer 8a9bdc8177 Fix ParseUint to support all possible numbers
Fixes #461
2018-11-14 01:59:18 +08:00
Jiajun Huang 9d6d9b7cd5 fix go vet do not work on noCopy 2018-11-13 23:03:30 +05:30
Berezhnoy Pavel e771b6fe43 #457: allow to rewrite system error response (#458)
* #457: allow to rewrite system error response

* #457: review fixes

* #457: more review issues fixed
2018-11-13 15:41:42 +03:00
Erik Dubbelboer fcaab424ca Don't retry client requests with ErrBodyTooLarge
Fixes #455
2018-11-12 13:23:42 +08:00
dgrr 63a0b46e2d Changed hasNextProto name to getNextProto and deleted TODO. 2018-11-12 10:27:32 +05:30
dgrr 3fb1313e33 Changed *tls.Conn by extended connTLSer 2018-11-12 10:27:32 +05:30
dgrr d37102dec8 Fixed NextProto error caused by non-Handshake call.
As you can see here https://golang.org/src/crypto/tls/conn.go#L1041
crypto/tls.Conn does not perform a TLS handshake until Read or Write functions are called.
Then the solution is to call crypto/tls.Conn.Handshake() to check Client values.
2018-11-12 10:27:32 +05:30
Erik Dubbelboer 8f4c5d5d1d Change HostClient.pendingRequest to an int32
atomic.AddUint64 needs a 64bit aligned address on x86, int32 is more
than enough and keeps the code more readable.

Fixes #451
2018-11-03 22:34:05 +08:00
Dmitry Yu Okunev 6b0a1c55ef Added a comment to (*Server).GetCurrentConcurrency() 2018-11-03 18:14:29 +05:30
Dmitry Yu Okunev 5684318399 Fixed race-condition of the method (*Server).GetCurrenctConcurrency() 2018-11-03 18:14:29 +05:30
Dmitry Yu Okunev 0915d6166b Added method (*Server).GetCurrenctConcurrency() 2018-11-03 18:14:29 +05:30
Erik Dubbelboer aebec409b0 Only remove a HostClient from Client if it is unused 2018-11-01 19:05:53 +08:00
Erik Dubbelboer 192515395f Add Client.NoDefaultUserAgentHeader 2018-11-01 12:44:17 +08:00
Sigalas Alexandros 1b3ac0ccc9 Fix Server.ConnState hook #441 2018-10-28 23:27:08 +05:30
Harald Nordgren f9004bedab Bump Go versions and use '.x' to always get latest minor versions 2018-10-28 23:26:41 +05:30
Gabriel Pérez S 996610f021 Schema changes detection with HostClient
Related with the issue https://github.com/valyala/fasthttp/issues/244
2018-10-14 16:19:09 +03:00
Erik Dubbelboer afcef43292 Add RequestCtx.Conn() method
Fixes #286
2018-10-14 10:38:42 +02:00
Erik Dubbelboer 573be81328 Hopefully fix TestShutdownReuse flakiness 2018-10-14 10:18:21 +02:00
Erik Dubbelboer 63ea2d380f Remove invalid test introduced in #378
Header normalization has been changed since pull request #378 was made.
These days header case doesn't matter when looking up headers.
2018-10-06 01:02:45 +08:00
Tommy Chen d459e257bf Use form headers in WriteMultipartForm
CreateFormFile always set Content-Type header to application/octet-stream.
Use CreatePart instead so all headers in the multipart form can be used.
2018-10-05 19:02:16 +03:00
Erik Dubbelboer 4dfc12997e Add RequestHeader.RawHeaders() 2018-10-05 19:00:55 +03:00
Erik Dubbelboer 8dfc881b9e Added Server.nextProtos
This implementation allows user to handle crypto/tls.Config.NextProtos to use their own handlers for the negotiated TLS protos like HTTP/2.
Workerpool where changed to adapt WorkerFunc to another conns server with ServeConn type and contains the Server structure which creates to check configured protos.
2018-10-05 16:35:59 +08:00
mmta 33b80a5951 Add support for named profiles like heap, goroutine, threadcreate, allocs, block, and mutex. 2018-10-03 18:15:43 +03:00
Oleg Kovalov 4087354082 Support Go modules v1.0.0 2018-10-01 15:33:33 +08:00
Erik Dubbelboer d4f0cf56d8 Remove fasthttp.ByteBuffer
As advertised in https://github.com/valyala/fasthttp/commit/b5f96d4b4120bb1e09c23ac32baf21a14da4a71d
2018-10-01 14:15:29 +08:00
bslizon 761788a34b Add tcp keepalive 2018-09-27 15:22:58 +03:00
bslizon 2e04bb8884 enable TCP keep-alives 2018-09-27 15:22:58 +03:00
Erik Dubbelboer be257bcef6 Improve Shutdown behaviour 2018-09-27 17:38:34 +08:00
Erik Dubbelboer 7ec2b18772 Remove race condition from test 2018-09-24 22:46:21 +08:00
Erik Dubbelboer b3b6b8cb28 Fix Request.connectionCloseFast bugs
See https://github.com/valyala/fasthttp/pull/265
and https://github.com/valyala/fasthttp/issues/220
and https://github.com/valyala/fasthttp/issues/264
2018-09-24 21:30:30 +08:00
Erik Dubbelboer 3d4ce5b57c Fix data race errors
Server.Shutdown was causing data race errors. One issue was that it was
possible for sync.WaitGroup.Add() to be called while Shutdown was already
calling .Wait(). To fix this I have removed the WaitGroup and replaced
it with atomic counters and a semi busy wait loop.

Fixes #416
2018-09-24 21:22:40 +08:00
Erik Dubbelboer 1ba43613e8 Clarify how to do relative redirects
Fixes #328
2018-09-20 18:06:11 +08:00
Erik Dubbelboer b5f96d4b41 WARNING: fasthttp.ByteBuffer will be removed! 2018-09-20 16:21:42 +08:00
Erik Dubbelboer c67f81e5f9 Use PostArgs in client
See: https://github.com/erikdubbelboer/fasthttp/issues/17
2018-09-20 15:22:18 +08:00
Erik Dubbelboer d53df67945 Fix Content-Type bug in FS
Fixes #417
2018-09-20 11:36:07 +08:00
David Byttow da9ba61e3b Allows for empty content type by default. Fixes #214 2018-09-19 01:28:32 +03:00
Emir Beganović 351f874e5e Fix small typo in readme 2018-09-17 14:42:35 +08:00
Oleg Kovalov 10a0540dfc Remove redundant else statements 2018-09-14 10:00:13 +08:00
Erik Dubbelboer 869903cf7a Fix Cookie peek
See: https://github.com/valyala/fasthttp/issues/313
2018-09-13 12:42:54 +08:00