From 63d040839bc8ac45910426be62a096c13a783229 Mon Sep 17 00:00:00 2001 From: Seednode Date: Sun, 26 Feb 2023 18:57:52 -0600 Subject: [PATCH] Updated transitive dependencies --- cmd/web.go | 1 + go.mod | 2 +- go.sum | 4 +- stats.file | Bin 0 -> 1134 bytes .../klauspost/compress/.goreleaser.yml | 2 +- .../github.com/klauspost/compress/README.md | 6 +++ .../klauspost/compress/huff0/decompress.go | 2 +- .../compress/internal/snapref/encode_other.go | 22 +++++++++ .../klauspost/compress/zstd/dict.go | 43 ++++++++++++++++-- .../klauspost/compress/zstd/enc_base.go | 2 +- vendor/modules.txt | 4 +- 11 files changed, 77 insertions(+), 11 deletions(-) create mode 100644 stats.file diff --git a/cmd/web.go b/cmd/web.go index d003691..d75550b 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -13,6 +13,7 @@ import ( "log" "math/rand" "net/http" + _ "net/http/pprof" "net/url" "os" "os/signal" diff --git a/go.mod b/go.mod index fcf0dcb..049c7ff 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/h2non/filetype v1.1.3 - github.com/klauspost/compress v1.15.15 + github.com/klauspost/compress v1.16.0 github.com/spf13/cobra v1.6.1 github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4 golang.org/x/image v0.5.0 diff --git a/go.sum b/go.sum index e3c0fbb..a4dab12 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= diff --git a/stats.file b/stats.file new file mode 100644 index 0000000000000000000000000000000000000000..5a76c1fb283390f155599bcd5eef660150cc2b41 GIT binary patch literal 1134 zcmV-!1d;nFwJ-f-Fct+P0D^X~KtQWB0md;5!!QiPFbu=+w{6>gvS<`Znn7j~E2d<8 zCb(KeM-pgP%`|97Jrp8DgjVkSa@)m|#?f8nST(i&4w3uB<(B9a^lEcO42?t>MG>O~FZa+?6Vd9f>H;Y$x&~5FED12d(JahfJRK)uOi#q1YtHe%AqE({GZ~cENA5V*OpG zK{5LFA++O~$a<}`=-Y9Uqqh%fOKT-kbI`P-KlZ*SH>&$)X1wQKiuI;vM!%eo(ZS6R zR_?z^d+Uc*Y`FPBk6z{GJ<6%{;(k1)DmUHPuNVCu<#eSNeLo%}+=l`&8fu%H`YP1p zp%=Z)P1{OSw2S${jQexiM|8hc`}nRi-T9uZ|E)0S?>ZvfhXOC|o+>dm4FlD0u<=xh z(VK=fsD6Xqw0)17Jl2}@yjF3-eJC)xa}t|=e(aSSUH@9iX-;Aw-25O#`B$1v_FCFu zG$^J1M}MUr-25QM@@Zv-o_v+v_i3EAwB4$v@*(|Mcjbr*{fvbBP+;Y*$&X%<=BBh- zS25Y=G%sT^u`-+fYALdQOe?hHqt#+EnbJ=0(QeX^U<#p<10ABsLWm25!Q95{6Ki{X&wRQhYO(uQ53;VS+9lg0D>7nh0uX0ia3PWz9%~Z zIMNW}mmoP09AOCYogZ2ufFlbbzE*NP@B>E_LTs;gIiFIWv;D2~TloUa0Vaer0)U+$ zU?M1EFl8I0NI+?_K+3&XC42&Vp-7N&k7>K;@K7NEa*vh11Y9gRIrtGJOum5OG8C%ZlLdS@o1x{>8-WlrNNUZx z61ZG%ETF!sGgK~CVQ7YpTA5M=s@${_Q0W8(+X|Vl2FVznoF0UnP&;)^FholO7Ym@= zJ_3f2lyY_{bTHTugd2i-*wgJWnsMt2>s5fV9z@78UEsITKr{%CfiNQicu-aD{4OL9Ot=wxf`N4k#|zJe5#!60 zgds6DF6`N1GLBu`B=J~o6bURCV_{edT6hm18;j3P;d!}mgB}q?C?f=7n?>Dn!Q4{l zW>rfN+)}`Vi6v&Z(%Ktb83p19M 255 { return s, nil, errors.New("corrupt input: output table too large") diff --git a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go index 298c4f8..05db94d 100644 --- a/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go +++ b/vendor/github.com/klauspost/compress/internal/snapref/encode_other.go @@ -103,6 +103,28 @@ func hash(u, shift uint32) uint32 { return (u * 0x1e35a7bd) >> shift } +// EncodeBlockInto exposes encodeBlock but checks dst size. +func EncodeBlockInto(dst, src []byte) (d int) { + if MaxEncodedLen(len(src)) > len(dst) { + return 0 + } + + // encodeBlock breaks on too big blocks, so split. + for len(src) > 0 { + p := src + src = nil + if len(p) > maxBlockSize { + p, src = p[:maxBlockSize], p[maxBlockSize:] + } + if len(p) < minNonLiteralBlockSize { + d += emitLiteral(dst[d:], p) + } else { + d += encodeBlock(dst[d:], p) + } + } + return d +} + // encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It // assumes that the varint-encoded length of the decompressed bytes has already // been written. diff --git a/vendor/github.com/klauspost/compress/zstd/dict.go b/vendor/github.com/klauspost/compress/zstd/dict.go index 66a95c1..ca09514 100644 --- a/vendor/github.com/klauspost/compress/zstd/dict.go +++ b/vendor/github.com/klauspost/compress/zstd/dict.go @@ -32,14 +32,38 @@ func (d *dict) ID() uint32 { return d.id } -// DictContentSize returns the dictionary content size or 0 if d is nil. -func (d *dict) DictContentSize() int { +// ContentSize returns the dictionary content size or 0 if d is nil. +func (d *dict) ContentSize() int { if d == nil { return 0 } return len(d.content) } +// Content returns the dictionary content. +func (d *dict) Content() []byte { + if d == nil { + return nil + } + return d.content +} + +// Offsets returns the initial offsets. +func (d *dict) Offsets() [3]int { + if d == nil { + return [3]int{} + } + return d.offsets +} + +// LitEncoder returns the literal encoder. +func (d *dict) LitEncoder() *huff0.Scratch { + if d == nil { + return nil + } + return d.litEnc +} + // Load a dictionary as described in // https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format func loadDict(b []byte) (*dict, error) { @@ -64,7 +88,7 @@ func loadDict(b []byte) (*dict, error) { var err error d.litEnc, b, err = huff0.ReadTable(b[8:], nil) if err != nil { - return nil, err + return nil, fmt.Errorf("loading literal table: %w", err) } d.litEnc.Reuse = huff0.ReusePolicyMust @@ -122,3 +146,16 @@ func loadDict(b []byte) (*dict, error) { return &d, nil } + +// InspectDictionary loads a zstd dictionary and provides functions to inspect the content. +func InspectDictionary(b []byte) (interface { + ID() uint32 + ContentSize() int + Content() []byte + Offsets() [3]int + LitEncoder() *huff0.Scratch +}, error) { + initPredefined() + d, err := loadDict(b) + return d, err +} diff --git a/vendor/github.com/klauspost/compress/zstd/enc_base.go b/vendor/github.com/klauspost/compress/zstd/enc_base.go index bfb2e14..e008b99 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_base.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -149,7 +149,7 @@ func (e *fastBase) resetBase(d *dict, singleBlock bool) { if singleBlock { e.lowMem = true } - e.ensureHist(d.DictContentSize() + maxCompressedBlockSize) + e.ensureHist(d.ContentSize() + maxCompressedBlockSize) e.lowMem = low } diff --git a/vendor/modules.txt b/vendor/modules.txt index 97b24ff..e6ca89c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -7,8 +7,8 @@ github.com/h2non/filetype/types # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap -# github.com/klauspost/compress v1.15.15 -## explicit; go 1.17 +# github.com/klauspost/compress v1.16.0 +## explicit; go 1.18 github.com/klauspost/compress github.com/klauspost/compress/fse github.com/klauspost/compress/huff0