Skip to content

Commit 277a485

Browse files
committed
revert proto revision header
1 parent 339f413 commit 277a485

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

conn_http.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"net/http"
3434
"net/url"
3535
"os"
36-
"strconv"
3736
"strings"
3837
"sync"
3938
"time"
@@ -216,7 +215,8 @@ func dialHttp(ctx context.Context, addr string, num int, opt *Options) (*httpCon
216215
}
217216

218217
query.Set("default_format", "Native")
219-
query.Set("client_protocol_version", strconv.Itoa(ClientTCPProtocolVersion))
218+
// TODO: we support newer revisions but for some reason this completely breaks Native format
219+
//query.Set("client_protocol_version", strconv.Itoa(ClientTCPProtocolVersion))
220220
u.RawQuery = query.Encode()
221221

222222
httpProxy := http.ProxyFromEnvironment
@@ -251,8 +251,9 @@ func dialHttp(ctx context.Context, addr string, num int, opt *Options) (*httpCon
251251
client: &http.Client{
252252
Transport: t,
253253
},
254-
url: u,
255-
revision: ClientTCPProtocolVersion,
254+
url: u,
255+
// TODO: learn more about why revision is broken
256+
//revision: ClientTCPProtocolVersion,
256257
buffer: new(chproto.Buffer),
257258
compression: opt.Compression.Method,
258259
blockCompressor: compress.NewWriter(compress.Level(opt.Compression.Level), compress.Method(opt.Compression.Method)),
@@ -407,7 +408,7 @@ func (h *httpConnect) writeData(block *proto.Block) error {
407408
// Saving offset of compressible data
408409
start := len(h.buffer.Buf)
409410
if err := block.Encode(h.buffer, h.revision); err != nil {
410-
return err
411+
return fmt.Errorf("block encode: %w", err)
411412
}
412413
if h.compression == CompressionLZ4 || h.compression == CompressionZSTD {
413414
// Performing compression. Supported and requires

0 commit comments

Comments
 (0)