Add File() method to Ratelimitlistener for extracting underlying fd()

master
Harshavardhana 10 years ago
parent 2e8f154f34
commit e4574c7d6f
  1. 7
      pkg/server/minhttp/listen.go

@ -18,6 +18,7 @@ package minhttp
import ( import (
"net" "net"
"os"
"sync" "sync"
"github.com/minio/minio/pkg/iodine" "github.com/minio/minio/pkg/iodine"
@ -37,6 +38,12 @@ type rateLimitListener struct {
func (l *rateLimitListener) accept() { l.sem <- struct{}{} } func (l *rateLimitListener) accept() { l.sem <- struct{}{} }
func (l *rateLimitListener) release() { <-l.sem } func (l *rateLimitListener) release() { <-l.sem }
// File - necessary to expose underlying socket fd
func (l *rateLimitListener) File() (f *os.File, err error) {
return l.Listener.(fileListener).File()
}
// Accept - accept method for accepting new connections
func (l *rateLimitListener) Accept() (net.Conn, error) { func (l *rateLimitListener) Accept() (net.Conn, error) {
l.accept() l.accept()

Loading…
Cancel
Save