Skip to content

Commit f00d992

Browse files
committed
Pull request #430: AGDNS-3952-udp-id
Merge in GO/dnsproxy from AGDNS-3952-udp-id to master Squashed commit of the following: commit e74206b Author: Ainar Garipov <a.garipov@adguard.com> Date: Tue Apr 28 19:43:03 2026 +0300 upstream: imp code commit c281d1a Author: Ainar Garipov <a.garipov@adguard.com> Date: Tue Apr 28 17:27:08 2026 +0300 all: imp code commit 629588a Author: Ainar Garipov <a.garipov@adguard.com> Date: Tue Apr 28 14:17:51 2026 +0300 all: set id in udp when unset; go fix
1 parent 05f86f0 commit f00d992

15 files changed

Lines changed: 55 additions & 40 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ GOAMD64 = v1
2424
GOPROXY = https://proxy.golang.org|direct
2525
GOTELEMETRY = off
2626
OUT = dnsproxy
27-
GOTOOLCHAIN = go1.26.1
27+
GOTOOLCHAIN = go1.26.2
2828
RACE = 0
2929
REVISION = $${REVISION:-$$(git rev-parse --short HEAD)}
3030
VERSION = 0

bamboo-specs/bamboo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# exact patch version as opposed to a minor one to make sure that this exact
1414
# version is actually used and not whatever the docker daemon on the CI has
1515
# cached a few months ago.
16-
'dockerGo': 'adguard/go-builder:1.26.1--1'
16+
'dockerGo': 'adguard/go-builder:1.26.2--1'
1717
'maintainer': 'Adguard Go Team'
1818
'name': 'dnsproxy'
1919

docker/ci.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# needed. Keep it in sync with bamboo-specs/bamboo.yaml.
2929

3030
# NOTE: Keep in sync with bamboo-specs/bamboo.yaml.
31-
ARG BASE_IMAGE=adguard/go-builder:1.26.1--1
31+
ARG BASE_IMAGE=adguard/go-builder:1.26.2--1
3232

3333
# The dependencies stage is needed to install packages and tool dependencies.
3434
# This is also where binaries like osslsigncode, which may be required for tests

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/AdguardTeam/dnsproxy
22

3-
go 1.26.1
3+
go 1.26.2
44

55
require (
66
github.com/AdguardTeam/golibs v0.35.10

internal/cmd/proxy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ func loadServersList(sources []string) []string {
526526
servers = append(servers, source)
527527
}
528528

529-
lines := strings.Split(string(data), "\n")
530-
for _, line := range lines {
529+
// TODO(a.garipov): Be smarter about bytes vs. strings.
530+
for line := range strings.SplitSeq(string(data), "\n") {
531531
line = strings.TrimSpace(line)
532532

533533
// Ignore comments in the file.

proxy/errors.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !plan9
2-
// +build !plan9
32

43
package proxy
54

proxy/errors_internal_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !plan9
2-
// +build !plan9
32

43
package proxy
54

proxy/errors_plan9.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build plan9
2-
// +build plan9
32

43
package proxy
54

proxy/proxy_internal_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,7 @@ func newTxts(tb testing.TB, txtDataLen int) (txts []string) {
370370

371371
// *dns.TXT requires splitting the actual data into 256-byte chunks.
372372
for i := range txtDataChunkNum {
373-
r := txtDataChunkLen * (i + 1)
374-
if r > txtDataLen {
375-
r = txtDataLen
376-
}
373+
r := min(txtDataChunkLen*(i+1), txtDataLen)
377374
txts[i] = string(randData[txtDataChunkLen*i : r])
378375
}
379376

@@ -600,8 +597,8 @@ func TestExchangeWithReservedDomains(t *testing.T) {
600597
UpstreamConfig: newTestUpstreamConfigWithBoot(
601598
t,
602599
testTimeout,
603-
"[/adguard.com/]1.2.3.4",
604-
"[/google.ru/]2.3.4.5",
600+
"[/adguard.com/]192.0.2.1",
601+
"[/google.ru/]192.0.2.2",
605602
"[/maps.google.ru/]#",
606603
"1.1.1.1",
607604
),

proxy/serverquic_internal_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,7 @@ func writeQUICStream(buf []byte, stream *quic.Stream) (err error) {
289289
chunkSize := 400
290290
for i := 0; i < len(buf); i += chunkSize {
291291
chunkStart := i
292-
chunkEnd := i + chunkSize
293-
if chunkEnd > len(buf) {
294-
chunkEnd = len(buf)
295-
}
292+
chunkEnd := min(i+chunkSize, len(buf))
296293

297294
_, err = stream.Write(buf[chunkStart:chunkEnd])
298295
if err != nil {

0 commit comments

Comments
 (0)