Skip to content

Commit

Permalink
[util] move limitlistener to util for other protocol proxy use (#210)
Browse files Browse the repository at this point in the history
Co-authored-by: jxd134 <[email protected]>
  • Loading branch information
jxd134 and jxd1990 committed Aug 27, 2021
1 parent 6b08bc7 commit d5f4ead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pkg/object/httpserver/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/megaease/easegress/pkg/protocol"
"github.com/megaease/easegress/pkg/supervisor"
"github.com/megaease/easegress/pkg/util/httpstat"
"github.com/megaease/easegress/pkg/util/limitlistener"
"github.com/megaease/easegress/pkg/util/topn"
)

Expand Down Expand Up @@ -81,7 +82,7 @@ type (

httpStat *httpstat.HTTPStat
topN *topn.TopN
limitListener *LimitListener
limitListener *limitlistener.LimitListener
}

// Status contains all status generated by runtime, for displaying to users.
Expand Down Expand Up @@ -275,7 +276,7 @@ func (r *runtime) startServer() {
return
}

limitListener := NewLimitListener(listener, r.spec.MaxConnections)
limitListener := limitlistener.NewLimitListener(listener, r.spec.MaxConnections)
r.limitListener = limitListener
go r.runHTTP1And2Server(limitListener, r.spec.HTTPS, r.startNum)
}
Expand All @@ -291,7 +292,7 @@ func (r *runtime) runHTTP3Server(startNum uint64) {
}
}

func (r *runtime) runHTTP1And2Server(limitListener *LimitListener, https bool, startNum uint64) {
func (r *runtime) runHTTP1And2Server(limitListener *limitlistener.LimitListener, https bool, startNum uint64) {
var err error
if https {
err = r.server.ServeTLS(limitListener, "", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package httpserver
package limitlistener

import (
"context"
Expand Down

0 comments on commit d5f4ead

Please sign in to comment.