mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 20:20:25 +03:00
add codespell action (#18818)
Original work here, #18474, refixed and updated.
This commit is contained in:
@@ -27,11 +27,11 @@ import (
|
||||
// convenient wrapper to drain any remaining data on response body.
|
||||
//
|
||||
// Subsequently this allows golang http RoundTripper
|
||||
// to re-use the same connection for future requests.
|
||||
// to reuse the same connection for future requests.
|
||||
func DrainBody(respBody io.ReadCloser) {
|
||||
// Callers should close resp.Body when done reading from it.
|
||||
// If resp.Body is not closed, the Client's underlying RoundTripper
|
||||
// (typically Transport) may not be able to re-use a persistent TCP
|
||||
// (typically Transport) may not be able to reuse a persistent TCP
|
||||
// connection to the server for a subsequent "keep-alive" request.
|
||||
if respBody != nil {
|
||||
// Drain any remaining Body and then close the connection.
|
||||
|
||||
@@ -118,7 +118,7 @@ const (
|
||||
// Dummy putBucketACL
|
||||
AmzACL = "x-amz-acl"
|
||||
|
||||
// Signature V4 related contants.
|
||||
// Signature V4 related constants.
|
||||
AmzContentSha256 = "X-Amz-Content-Sha256"
|
||||
AmzDate = "X-Amz-Date"
|
||||
AmzAlgorithm = "X-Amz-Algorithm"
|
||||
|
||||
@@ -32,7 +32,7 @@ type acceptResult struct {
|
||||
|
||||
// httpListener - HTTP listener capable of handling multiple server addresses.
|
||||
type httpListener struct {
|
||||
tcpListeners []*net.TCPListener // underlaying TCP listeners.
|
||||
tcpListeners []*net.TCPListener // underlying TCP listeners.
|
||||
acceptCh chan acceptResult // channel where all TCP listeners write accepted connection.
|
||||
ctx context.Context
|
||||
ctxCanceler context.CancelFunc
|
||||
|
||||
@@ -109,7 +109,7 @@ func (srv *Server) Init(listenCtx context.Context, listenErrCallback func(listen
|
||||
wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// If server is in shutdown.
|
||||
if atomic.LoadUint32(&srv.inShutdown) != 0 {
|
||||
// To indicate disable keep-alives
|
||||
// To indicate disable keep-alive
|
||||
w.Header().Set("Connection", "close")
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
w.Write([]byte(http.ErrServerClosed.Error()))
|
||||
|
||||
Reference in New Issue
Block a user