Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for GetOffsetLength (0.21 sec)

  1. cmd/httprange_test.go

    		{"bytes=-1000", 0, 10},
    	}
    	for i, testCase := range validRangeSpecs {
    		rs, err := parseRequestRangeSpec(testCase.spec)
    		if err != nil {
    			t.Errorf("unexpected err: %v", err)
    		}
    		o, l, err := rs.GetOffsetLength(resourceSize)
    		if err != nil {
    			t.Errorf("unexpected err: %v", err)
    		}
    		if o != testCase.expOffset || l != testCase.expLength {
    			t.Errorf("Case %d: got bad offset/length: %d,%d expected: %d,%d",
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun May 05 16:56:21 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  2. cmd/httprange.go

    	default:
    		return 0, errors.New("Unexpected range specification case")
    	}
    
    	return rangeLength, nil
    }
    
    // GetOffsetLength computes the start offset and length of the range
    // given the size of the resource
    func (h *HTTPRangeSpec) GetOffsetLength(resourceSize int64) (start, length int64, err error) {
    	if h == nil {
    		// No range specified, implies whole object.
    		return 0, resourceSize, nil
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu May 09 08:44:07 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  3. cmd/veeam-sos-api.go

    	default:
    		return nil, errFileNotFound
    	}
    
    	etag := getMD5Hash(buf)
    	r := bytes.NewReader(buf)
    
    	off, length := int64(0), r.Size()
    	if rs != nil {
    		off, length, err = rs.GetOffsetLength(r.Size())
    		if err != nil {
    			return nil, err
    		}
    	}
    	r.Seek(off, io.SeekStart)
    
    	return NewGetObjectReaderFromReader(io.LimitReader(r, length), ObjectInfo{
    		Bucket:      bucket,
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Aug 15 00:34:56 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  4. cmd/api-headers.go

    	if err != nil {
    		return err
    	}
    
    	if rs == nil && opts.PartNumber > 0 {
    		rs = partNumberToRangeSpec(objInfo, opts.PartNumber)
    	}
    
    	// For providing ranged content
    	start, rangeLen, err = rs.GetOffsetLength(totalObjectSize)
    	if err != nil {
    		return err
    	}
    
    	// Set content length.
    	w.Header().Set(xhttp.ContentLength, strconv.FormatInt(rangeLen, 10))
    	if rs != nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue May 28 04:44:00 UTC 2024
    - 7K bytes
    - Viewed (0)
  5. cmd/object-api-utils.go

    			return nil, 0, 0, err
    		}
    		var decryptSkip int64
    		var seqNum uint32
    
    		off, length = int64(0), oi.Size
    		decOff, decLength := int64(0), actualSize
    		if rs != nil {
    			off, length, err = rs.GetOffsetLength(actualSize)
    			if err != nil {
    				return nil, 0, 0, err
    			}
    			decrypt := func(b []byte) ([]byte, error) {
    				return b, nil
    			}
    			if isEncrypted {
    				decrypt = func(b []byte) ([]byte, error) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Aug 08 15:29:58 UTC 2024
    - 37.1K bytes
    - Viewed (0)
  6. cmd/object-multipart-handlers.go

    		writeCopyPartErr(ctx, w, partRangeErr, r.URL)
    		return
    	}
    
    	// Get the object offset & length
    	startOffset, length, err := rs.GetOffsetLength(actualPartSize)
    	if err != nil {
    		writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    		return
    	}
    
    	// maximum copy size for multipart objects in a single operation
    	if isMaxObjectSize(length) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Aug 31 18:25:48 UTC 2024
    - 39.2K bytes
    - Viewed (0)
  7. cmd/encryption-v1.go

    		if err != nil {
    			err = errObjectTampered
    			return
    		}
    		sizes = []int64{int64(partSize)}
    		decObjSize = sizes[0]
    	}
    
    	var off, length int64
    	off, length, err = rs.GetOffsetLength(decObjSize)
    	if err != nil {
    		return
    	}
    
    	// At this point, we have:
    	//
    	// 1. the decrypted part sizes in `sizes` (single element for
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Oct 13 13:06:08 UTC 2024
    - 37.2K bytes
    - Viewed (0)
  8. cmd/erasure-object.go

    	if crypto.SSEC.IsEncrypted(objInfo.UserDefined) && opts.ReplicationRequest {
    		opts.NoDecryption = true
    	}
    
    	if objInfo.Size == 0 {
    		if _, _, err := rs.GetOffsetLength(objInfo.Size); err != nil {
    			// Make sure to return object info to provide extra information.
    			return &GetObjectReader{
    				ObjInfo: objInfo,
    			}, err
    		}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 78.8K bytes
    - Viewed (0)
  9. cmd/object-handlers_test.go

    			rs, err = parseRequestRangeSpec(byteRange)
    			if err != nil {
    				t.Fatalf("Object: %s Case %d ByteRange: %s: Unexpected err: %v", object, i+1, byteRange, err)
    			}
    		}
    		off, length, err = rs.GetOffsetLength(objectLength(oi))
    		if err != nil {
    			t.Fatalf("Object: %s Case %d ByteRange: %s: Unexpected err: %v", object, i+1, byteRange, err)
    		}
    
    		readers := []io.Reader{}
    		cumulativeSum := int64(0)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Sep 12 20:10:44 UTC 2024
    - 163.2K bytes
    - Viewed (0)
Back to top