Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for DrainBody (0.36 sec)

  1. internal/http/close.go

    package http
    
    import (
    	"io"
    
    	xioutil "github.com/minio/minio/internal/ioutil"
    )
    
    // DrainBody close non nil response with any response Body.
    // convenient wrapper to drain any remaining data on response body.
    //
    // Subsequently this allows golang http RoundTripper
    // to reuse the same connection for future requests.
    func DrainBody(respBody io.ReadCloser) {
    	// Callers should close resp.Body when done reading from it.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  2. cmd/storage-rest-client.go

    	values.Set(storageRESTVolume, volume)
    	values.Set(storageRESTFilePath, path)
    	reader := bytes.NewReader(buf)
    	respBody, err := client.call(ctx, storageRESTMethodAppendFile, values, reader, -1)
    	defer xhttp.DrainBody(respBody)
    	return err
    }
    
    func (client *storageRESTClient) CreateFile(ctx context.Context, origvolume, volume, path string, size int64, reader io.Reader) error {
    	values := make(url.Values)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 26K bytes
    - Viewed (0)
  3. cmd/peer-rest-client.go

    	if err != nil {
    		return err
    	}
    	defer xhttp.DrainBody(respBody)
    	return nil
    }
    
    // DownloadProfileData - download profiled data from a remote node.
    func (client *peerRESTClient) DownloadProfileData() (data map[string][]byte, err error) {
    	respBody, err := client.call(peerRESTMethodDownloadProfilingData, nil, nil, -1)
    	if err != nil {
    		return
    	}
    	defer xhttp.DrainBody(respBody)
    	err = gob.NewDecoder(respBody).Decode(&data)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 25.8K bytes
    - Viewed (0)
  4. internal/event/target/elasticsearch.go

    		return false, store.ErrNotConnected
    	}
    	xhttp.DrainBody(resp.Body)
    	return !resp.IsError(), nil
    }
    
    func (c *esClientV7) entryExists(ctx context.Context, index string, key string) (bool, error) {
    	res, err := c.Exists(
    		index,
    		key,
    		c.Exists.WithContext(ctx),
    	)
    	if err != nil {
    		return false, err
    	}
    	xhttp.DrainBody(res.Body)
    	return !res.IsError(), nil
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 15K bytes
    - Viewed (0)
  5. internal/config/cache/cache.go

    	if err != nil {
    		return nil, err
    	}
    
    	resp, err := c.clnt.Do(req)
    	if err != nil {
    		return nil, err
    	}
    	defer xhttp.DrainBody(resp.Body)
    
    	switch resp.StatusCode {
    	case http.StatusNotFound:
    		return nil, ErrKeyMissing
    	case http.StatusOK:
    		co := &ObjectInfo{}
    		return co, co.DecodeMsg(msgp.NewReader(resp.Body))
    	default:
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  6. internal/config/dns/operator_dns.go

    		return newError(bucket, err)
    	}
    
    	resp, err := c.httpClient.Do(req)
    	if err != nil {
    		if derr := c.Delete(bucket); derr != nil {
    			return newError(bucket, derr)
    		}
    		return err
    	}
    	defer xhttp.DrainBody(resp.Body)
    
    	if resp.StatusCode != http.StatusOK {
    		var errorStringBuilder strings.Builder
    		io.Copy(&errorStringBuilder, io.LimitReader(resp.Body, resp.ContentLength))
    		errorString := errorStringBuilder.String()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 06 16:56:10 GMT 2023
    - 6.6K bytes
    - Viewed (0)
  7. cmd/warm-backend.go

    	if err != nil {
    		if _, ok := err.(BackendDown); ok {
    			return err
    		}
    		return tierPermErr{
    			Op:  tierPut,
    			Err: err,
    		}
    	}
    
    	r, err := w.Get(ctx, probeObject, "", WarmBackendGetOpts{})
    	xhttp.DrainBody(r)
    	if err != nil {
    		if _, ok := err.(BackendDown); ok {
    			return err
    		}
    		switch {
    		case isErrBucketNotFound(err):
    			return errTierBucketNotFound
    		case isErrSignatureDoesNotMatch(err):
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Apr 21 11:43:18 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  8. cmd/config-current.go

    	case config.PolicyPluginSubSys:
    		if ppargs, err := polplugin.LookupConfig(s, GetDefaultConnSettings(), xhttp.DrainBody); err != nil {
    			return err
    		} else if ppargs.URL == nil {
    			// Check if legacy opa is configured.
    			if _, err := opa.LookupConfig(s[config.PolicyOPASubSys][config.Default],
    				NewHTTPTransport(), xhttp.DrainBody); err != nil {
    				return err
    			}
    		}
    	case config.BrowserSubSys:
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Apr 21 11:43:18 GMT 2024
    - 30.9K bytes
    - Viewed (0)
  9. internal/config/subnet/subnet.go

    	client := &http.Client{
    		Timeout:   10 * time.Second,
    		Transport: c.transport,
    	}
    
    	resp, err := client.Do(r)
    	if err != nil {
    		return "", err
    	}
    	defer xhttp.DrainBody(resp.Body)
    
    	respBytes, err := io.ReadAll(io.LimitReader(resp.Body, respBodyLimit))
    	if err != nil {
    		return "", err
    	}
    	respStr := string(respBytes)
    
    	if resp.StatusCode == http.StatusOK {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Feb 27 16:35:36 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  10. internal/dsync/dsync-client_test.go

    	if err != nil {
    		return false, err
    	}
    	body := bytes.NewReader(buf)
    	respBody, err := restClient.rest.Call(context.Background(), method,
    		url.Values{}, body, body.Size())
    	defer xhttp.DrainBody(respBody)
    
    	switch toLockError(err) {
    	case nil:
    		return true, nil
    	case errLockConflict, errLockNotFound:
    		return false, nil
    	default:
    		return false, err
    	}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 20 17:36:09 GMT 2022
    - 4.4K bytes
    - Viewed (0)
Back to top