mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 16:22:24 -05:00
[feature] add per-uri dereferencer locks (#2291)
This commit is contained in:
parent
51d0a0bba5
commit
ce71a5a790
54 changed files with 2432 additions and 2719 deletions
21
vendor/github.com/klauspost/compress/gzip/gzip.go
generated
vendored
21
vendor/github.com/klauspost/compress/gzip/gzip.go
generated
vendored
|
|
@ -74,6 +74,27 @@ func NewWriterLevel(w io.Writer, level int) (*Writer, error) {
|
|||
return z, nil
|
||||
}
|
||||
|
||||
// MinCustomWindowSize is the minimum window size that can be sent to NewWriterWindow.
|
||||
const MinCustomWindowSize = flate.MinCustomWindowSize
|
||||
|
||||
// MaxCustomWindowSize is the maximum custom window that can be sent to NewWriterWindow.
|
||||
const MaxCustomWindowSize = flate.MaxCustomWindowSize
|
||||
|
||||
// NewWriterWindow returns a new Writer compressing data with a custom window size.
|
||||
// windowSize must be from MinCustomWindowSize to MaxCustomWindowSize.
|
||||
func NewWriterWindow(w io.Writer, windowSize int) (*Writer, error) {
|
||||
if windowSize < MinCustomWindowSize {
|
||||
return nil, errors.New("gzip: requested window size less than MinWindowSize")
|
||||
}
|
||||
if windowSize > MaxCustomWindowSize {
|
||||
return nil, errors.New("gzip: requested window size bigger than MaxCustomWindowSize")
|
||||
}
|
||||
|
||||
z := new(Writer)
|
||||
z.init(w, -windowSize)
|
||||
return z, nil
|
||||
}
|
||||
|
||||
func (z *Writer) init(w io.Writer, level int) {
|
||||
compressor := z.compressor
|
||||
if level != StatelessCompression {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue