Skip to content

Commit

Permalink
Upgrade fasthttp to v1.3.0 and router to v0.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Andres Virviescas Santana committed May 20, 2019
1 parent 7c8050e commit b656a37
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
language: go
sudo: false

go:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- tip

os:
- linux
- osx

matrix:
include:
- go: tip
env: ATREUGO_VERSION=v7
allow_failures:
- go: tip
fast_finish: true

before_install:
- go get -u -v github.com/mattn/goveralls

script:
# build test for supported platforms
- GOOS=linux go build
- GOOS=darwin go build
- GOOS=freebsd go build
- GOOS=windows go build
- GOARCH=386 go build

- $GOPATH/bin/goveralls -v -service=travis-ci -package github.com/savsgio/atreugo
- $GOPATH/bin/goveralls -v -service=travis-ci -package github.com/savsgio/atreugo/$ATREUGO_VERSION
2 changes: 2 additions & 0 deletions atreugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func New(cfg *Config) *Atreugo {
WriteBufferSize: cfg.Fasthttp.WriteBufferSize,
ReadTimeout: cfg.Fasthttp.ReadTimeout,
WriteTimeout: cfg.Fasthttp.WriteTimeout,
IdleTimeout: cfg.Fasthttp.IdleTimeout,
MaxConnsPerIP: cfg.Fasthttp.MaxConnsPerIP,
MaxRequestsPerConn: cfg.Fasthttp.MaxRequestsPerConn,
MaxKeepaliveDuration: cfg.Fasthttp.MaxKeepaliveDuration,
Expand All @@ -72,6 +73,7 @@ func New(cfg *Config) *Atreugo {
NoDefaultServerHeader: cfg.Fasthttp.NoDefaultServerHeader,
NoDefaultContentType: cfg.Fasthttp.NoDefaultContentType,
ConnState: cfg.Fasthttp.ConnState,
KeepHijackedConns: cfg.Fasthttp.KeepHijackedConns,
Logger: log,
},
log: log,
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/savsgio/atreugo/v7

require (
github.com/fasthttp/router v0.3.3
github.com/fasthttp/router v0.3.4
github.com/json-iterator/go v1.1.6
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/savsgio/go-logger v1.0.0
github.com/valyala/bytebufferpool v1.0.0
github.com/valyala/fasthttp v1.2.0
github.com/valyala/fasthttp v1.3.0
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/fasthttp/router v0.3.3 h1:pbXxvJqqb4PeNIIS//DwOtimK9hYchl33eoVgeIMNM8=
github.com/fasthttp/router v0.3.3/go.mod h1:lCf2TfRIzs3lgcFUGQah09Wu5BiEHcBPl3vm9QiXNTo=
github.com/fasthttp/router v0.3.4 h1:/ZlR7DKG1UOAgwY5ChxLIr+QFzoJylXb2Kc0qoU7cgM=
github.com/fasthttp/router v0.3.4/go.mod h1:Dox9pMCKygoMajltoDohsnHlP0iYFDDosirAN8TNr8U=
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/klauspost/compress v1.4.0 h1:8nsMz3tWa9SWWPL60G1V6CUsf4lLjWLTNEtibhe8gh8=
Expand All @@ -12,12 +12,12 @@ github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/savsgio/go-logger v1.0.0 h1:jiaRvohRr8RwtcK/WDcA/Yp4eaPaarAko3JNPzt1xoQ=
github.com/savsgio/go-logger v1.0.0/go.mod h1:/ZzTTmB3JJqjZQcLlxTGbwy3fIsLUoYyldsSEL5rU2g=
github.com/savsgio/gotils v0.0.0-20190210195551-a1aee1d83e72 h1:JEOaM8cQH5Z237uAdMAF6YXMcZXtaiTD2NECYwrYHl0=
github.com/savsgio/gotils v0.0.0-20190210195551-a1aee1d83e72/go.mod h1:w803/Fg1m0hrp1ZT9KNfQe4E4+WOMMFLcgzPvOcye10=
github.com/savsgio/gotils v0.0.0-20190409142739-e36d23089e10 h1:Rk4AHSMs6BX9Vb84H+SmYEA3X/VrtLV9qYSU/lc7xk4=
github.com/savsgio/gotils v0.0.0-20190409142739-e36d23089e10/go.mod h1:w803/Fg1m0hrp1ZT9KNfQe4E4+WOMMFLcgzPvOcye10=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.2.0 h1:dzZJf2IuMiclVjdw0kkT+f9u4YdrapbNyGAN47E/qnk=
github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/fasthttp v1.3.0 h1:++0WUtakkqBuHHY5JRFFl6O44I03XLBqxNnrBX0yH7Y=
github.com/valyala/fasthttp v1.3.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc=
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
12 changes: 12 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ type FasthttpConfig struct {
// By default response write timeout is unlimited.
WriteTimeout time.Duration

// IdleTimeout is the maximum amount of time to wait for the
// next request when keep-alive is enabled. If IdleTimeout
// is zero, the value of ReadTimeout is used.
IdleTimeout time.Duration

// Maximum number of concurrent client connections allowed per IP.
//
// By default unlimited number of concurrent connections
Expand Down Expand Up @@ -171,6 +176,13 @@ type FasthttpConfig struct {
// called when a client connection changes state. See the
// ConnState type and associated constants for details.
ConnState func(net.Conn, fasthttp.ConnState)

// KeepHijackedConns is an opt-in disable of connection
// close by fasthttp after connections' HijackHandler returns.
// This allows to save goroutines, e.g. when fasthttp used to upgrade
// http connections to WS and connection goes to another handler,
// which will close it when needed.
KeepHijackedConns bool
}

// Config config for Atreugo
Expand Down

0 comments on commit b656a37

Please sign in to comment.