mirror of
https://github.com/minio/minio.git
synced 2025-03-20 04:24:19 -04:00
Add File() method to Ratelimitlistener for extracting underlying fd()
This commit is contained in:
parent
2e8f154f34
commit
e4574c7d6f
@ -18,6 +18,7 @@ package minhttp
|
||||
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/minio/minio/pkg/iodine"
|
||||
@ -37,6 +38,12 @@ type rateLimitListener struct {
|
||||
func (l *rateLimitListener) accept() { l.sem <- struct{}{} }
|
||||
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) {
|
||||
l.accept()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user