Skip to content

Commit 0e69c45

Browse files
committed
Split out proxying into proxyConnection().
1 parent 0680221 commit 0e69c45

File tree

5 files changed

+83
-67
lines changed

5 files changed

+83
-67
lines changed

cmd/outline-ss-server/metrics.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,12 @@ func (m *outlineMetrics) AddClosedTCPConnection(clientInfo ipinfo.IPInfo, client
324324
}
325325
}
326326

327-
func (m *outlineMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, clientProxyBytes, proxyTargetBytes int) {
327+
func (m *outlineMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, data metrics.ProxyMetrics) {
328328
m.udpPacketsFromClientPerLocation.WithLabelValues(clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN), status).Inc()
329-
addIfNonZero(int64(clientProxyBytes), m.dataBytes, "c>p", "udp", accessKey)
330-
addIfNonZero(int64(clientProxyBytes), m.dataBytesPerLocation, "c>p", "udp", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN))
331-
addIfNonZero(int64(proxyTargetBytes), m.dataBytes, "p>t", "udp", accessKey)
332-
addIfNonZero(int64(proxyTargetBytes), m.dataBytesPerLocation, "p>t", "udp", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN))
329+
addIfNonZero(data.ClientProxy, m.dataBytes, "c>p", "udp", accessKey)
330+
addIfNonZero(data.ClientProxy, m.dataBytesPerLocation, "c>p", "udp", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN))
331+
addIfNonZero(data.ProxyTarget, m.dataBytes, "p>t", "udp", accessKey)
332+
addIfNonZero(data.ProxyTarget, m.dataBytesPerLocation, "p>t", "udp", clientInfo.CountryCode.String(), asnLabel(clientInfo.ASN))
333333
}
334334

335335
func (m *outlineMetrics) AddUDPPacketFromTarget(clientInfo ipinfo.IPInfo, accessKey, status string, targetProxyBytes, proxyClientBytes int) {

cmd/outline-ss-server/metrics_test.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,29 @@ func init() {
5252

5353
func TestMethodsDontPanic(t *testing.T) {
5454
ssMetrics := newPrometheusOutlineMetrics(nil, prometheus.NewPedanticRegistry())
55-
proxyMetrics := metrics.ProxyMetrics{
55+
tcpProxyMetrics := metrics.ProxyMetrics{
5656
ClientProxy: 1,
5757
ProxyTarget: 2,
5858
TargetProxy: 3,
5959
ProxyClient: 4,
6060
}
61+
udpProxyMetrics := metrics.ProxyMetrics{
62+
ClientProxy: 10,
63+
ProxyTarget: 20,
64+
TargetProxy: 30,
65+
ProxyClient: 40,
66+
}
6167
ipInfo := ipinfo.IPInfo{CountryCode: "US", ASN: 100}
6268
ssMetrics.SetBuildInfo("0.0.0-test")
6369
ssMetrics.SetNumAccessKeys(20, 2)
6470
ssMetrics.AddOpenTCPConnection(ipInfo)
6571
ssMetrics.AddAuthenticatedTCPConnection(fakeAddr("127.0.0.1:9"), "0")
66-
ssMetrics.AddClosedTCPConnection(ipInfo, fakeAddr("127.0.0.1:9"), "1", "OK", proxyMetrics, 10*time.Millisecond)
67-
ssMetrics.AddUDPPacketFromClient(ipInfo, "2", "OK", 10, 20)
72+
ssMetrics.AddClosedTCPConnection(ipInfo, fakeAddr("127.0.0.1:9"), "1", "OK", tcpProxyMetrics, 10*time.Millisecond)
73+
ssMetrics.AddUDPPacketFromClient(ipInfo, "2", "OK", udpProxyMetrics)
6874
ssMetrics.AddUDPPacketFromTarget(ipInfo, "3", "OK", 10, 20)
6975
ssMetrics.AddUDPNatEntry(fakeAddr("127.0.0.1:9"), "key-1")
7076
ssMetrics.RemoveUDPNatEntry(fakeAddr("127.0.0.1:9"), "key-1")
71-
ssMetrics.AddTCPProbe("ERR_CIPHER", "eof", 443, proxyMetrics.ClientProxy)
77+
ssMetrics.AddTCPProbe("ERR_CIPHER", "eof", 443, tcpProxyMetrics.ClientProxy)
7278
ssMetrics.AddTCPCipherSearch(true, 10*time.Millisecond)
7379
ssMetrics.AddUDPCipherSearch(true, 10*time.Millisecond)
7480
}
@@ -174,14 +180,19 @@ func BenchmarkProbe(b *testing.B) {
174180

175181
func BenchmarkClientUDP(b *testing.B) {
176182
ssMetrics := newPrometheusOutlineMetrics(nil, prometheus.NewRegistry())
183+
proxyMetrics := metrics.ProxyMetrics{
184+
ClientProxy: 1000,
185+
ProxyTarget: 2000,
186+
TargetProxy: 3000,
187+
ProxyClient: 4000,
188+
}
177189
clientInfo := ipinfo.IPInfo{CountryCode: "ZZ", ASN: 100}
178190
accessKey := "key 1"
179191
status := "OK"
180-
size := 1000
181192
timeToCipher := time.Microsecond
182193
b.ResetTimer()
183194
for i := 0; i < b.N; i++ {
184-
ssMetrics.AddUDPPacketFromClient(clientInfo, accessKey, status, size, size)
195+
ssMetrics.AddUDPPacketFromClient(clientInfo, accessKey, status, proxyMetrics)
185196
ssMetrics.AddUDPCipherSearch(true, timeToCipher)
186197
}
187198
}

internal/integration_test/integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ var _ service.UDPMetrics = (*fakeUDPMetrics)(nil)
262262
func (m *fakeUDPMetrics) GetIPInfo(ip net.IP) (ipinfo.IPInfo, error) {
263263
return ipinfo.IPInfo{CountryCode: "QQ"}, nil
264264
}
265-
func (m *fakeUDPMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, clientProxyBytes, proxyTargetBytes int) {
266-
m.up = append(m.up, udpRecord{clientInfo, accessKey, status, clientProxyBytes, proxyTargetBytes})
265+
func (m *fakeUDPMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, data metrics.ProxyMetrics) {
266+
m.up = append(m.up, udpRecord{clientInfo, accessKey, status, int(data.ClientProxy), int(data.ProxyTarget)})
267267
}
268268
func (m *fakeUDPMetrics) AddUDPPacketFromTarget(clientInfo ipinfo.IPInfo, accessKey, status string, targetProxyBytes, proxyClientBytes int) {
269269
m.down = append(m.down, udpRecord{clientInfo, accessKey, status, targetProxyBytes, proxyClientBytes})

service/udp.go

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package service
1616

1717
import (
18+
"context"
1819
"errors"
1920
"fmt"
2021
"net"
@@ -26,6 +27,7 @@ import (
2627
"github.com/Jigsaw-Code/outline-sdk/transport/shadowsocks"
2728
"github.com/Jigsaw-Code/outline-ss-server/ipinfo"
2829
onet "github.com/Jigsaw-Code/outline-ss-server/net"
30+
"github.com/Jigsaw-Code/outline-ss-server/service/metrics"
2931
logging "github.com/op/go-logging"
3032
"github.com/shadowsocks/go-shadowsocks2/socks"
3133
)
@@ -35,7 +37,7 @@ type UDPMetrics interface {
3537
ipinfo.IPInfoMap
3638

3739
// UDP metrics
38-
AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, clientProxyBytes, proxyTargetBytes int)
40+
AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, data metrics.ProxyMetrics)
3941
AddUDPPacketFromTarget(clientInfo ipinfo.IPInfo, accessKey, status string, targetProxyBytes, proxyClientBytes int)
4042
AddUDPNatEntry(clientAddr net.Addr, accessKey string)
4143
RemoveUDPNatEntry(clientAddr net.Addr, accessKey string)
@@ -119,15 +121,15 @@ func (h *packetHandler) Handle(clientConn net.PacketConn) {
119121

120122
for {
121123
status := "OK"
122-
keyID, clientInfo, clientProxyBytes, proxyTargetBytes, connErr := h.handleConnection(clientConn)
124+
keyID, clientInfo, proxyMetrics, connErr := h.handleConnection(context.TODO(), clientConn)
123125
if connErr != nil {
124126
if errors.Is(connErr.Cause, net.ErrClosed) {
125127
break
126128
}
127129
logger.Debugf("UDP Error: %v: %v", connErr.Message, connErr.Cause)
128130
status = connErr.Status
129131
}
130-
h.m.AddUDPPacketFromClient(clientInfo, keyID, status, clientProxyBytes, proxyTargetBytes)
132+
h.m.AddUDPPacketFromClient(clientInfo, keyID, status, proxyMetrics)
131133
}
132134
}
133135

@@ -157,52 +159,59 @@ func (h *packetHandler) authenticate(clientConn net.PacketConn) (net.Addr, *Ciph
157159
return clientAddr, cipherEntry, textData, clientProxyBytes, nil
158160
}
159161

160-
func (h *packetHandler) handleConnection(clientConn net.PacketConn) (string, ipinfo.IPInfo, int, int, *onet.ConnectionError) {
162+
func (h *packetHandler) proxyConnection(ctx context.Context, clientAddr net.Addr, tgtAddr net.Addr, clientConn net.PacketConn, cipherEntry CipherEntry, payload []byte, proxyMetrics *metrics.ProxyMetrics) (ipinfo.IPInfo, *onet.ConnectionError) {
163+
tgtConn := h.nm.Get(clientAddr.String())
164+
if tgtConn == nil {
165+
clientInfo, locErr := ipinfo.GetIPInfoFromAddr(h.m, clientAddr)
166+
if locErr != nil {
167+
logger.Warningf("Failed client info lookup: %v", locErr)
168+
}
169+
debugUDPAddr(clientAddr, "Got info \"%#v\"", clientInfo)
170+
171+
udpConn, err := net.ListenPacket("udp", "")
172+
if err != nil {
173+
return ipinfo.IPInfo{}, nil
174+
}
175+
tgtConn = h.nm.Add(clientAddr, clientConn, cipherEntry.CryptoKey, udpConn, clientInfo, cipherEntry.ID)
176+
}
177+
178+
proxyTargetBytes, err := tgtConn.WriteTo(payload, tgtAddr)
179+
proxyMetrics.ProxyTarget += int64(proxyTargetBytes)
180+
if err != nil {
181+
return tgtConn.clientInfo, onet.NewConnectionError("ERR_WRITE", "Failed to write to target", err)
182+
}
183+
return tgtConn.clientInfo, nil
184+
}
185+
186+
func (h *packetHandler) handleConnection(ctx context.Context, clientConn net.PacketConn) (string, ipinfo.IPInfo, metrics.ProxyMetrics, *onet.ConnectionError) {
161187
defer func() {
162188
if r := recover(); r != nil {
163189
logger.Errorf("Panic in UDP loop: %v. Continuing to listen.", r)
164190
debug.PrintStack()
165191
}
166192
}()
167193

194+
var proxyMetrics metrics.ProxyMetrics
168195
clientAddr, cipherEntry, textData, clientProxyBytes, authErr := h.authenticate(clientConn)
196+
proxyMetrics.ClientProxy += int64(clientProxyBytes)
169197
if authErr != nil {
170-
return "", ipinfo.IPInfo{}, clientProxyBytes, 0, authErr
198+
return "", ipinfo.IPInfo{}, proxyMetrics, authErr
171199
}
172200

173-
targetConn := h.nm.Get(clientAddr.String())
174-
if targetConn == nil {
175-
udpConn, err := net.ListenPacket("udp", "")
176-
if err != nil {
177-
return "", ipinfo.IPInfo{}, clientProxyBytes, 0, onet.NewConnectionError("ERR_CREATE_SOCKET", "Failed to create UDP socket", err)
178-
}
179-
180-
clientInfo, locErr := ipinfo.GetIPInfoFromAddr(h.m, clientAddr)
181-
if locErr != nil {
182-
logger.Warningf("Failed client info lookup: %v", locErr)
183-
}
184-
debugUDPAddr(clientAddr, "Got info \"%#v\"", clientInfo)
185-
186-
targetConn = h.nm.Add(clientAddr, clientConn, cipherEntry.CryptoKey, udpConn, clientInfo, cipherEntry.ID)
187-
}
188-
189-
payload, tgtUDPAddr, onetErr := h.validatePacket(textData)
201+
payload, tgtAddr, onetErr := h.getProxyRequest(textData)
190202
if onetErr != nil {
191-
return targetConn.keyID, targetConn.clientInfo, clientProxyBytes, 0, onetErr
203+
return cipherEntry.ID, ipinfo.IPInfo{}, proxyMetrics, onetErr
192204
}
205+
debugUDPAddr(clientAddr, "Proxy exit %s", tgtAddr.String())
193206

194-
debugUDPAddr(targetConn.clientAddr, "Proxy exit %v", targetConn.LocalAddr())
195-
proxyTargetBytes, err := targetConn.WriteTo(payload, tgtUDPAddr) // accept only UDPAddr despite the signature
196-
if err != nil {
197-
return targetConn.keyID, targetConn.clientInfo, clientProxyBytes, proxyTargetBytes, onet.NewConnectionError("ERR_WRITE", "Failed to write to target", err)
198-
}
199-
return targetConn.keyID, targetConn.clientInfo, clientProxyBytes, proxyTargetBytes, nil
207+
clientInfo, err := h.proxyConnection(ctx, clientAddr, tgtAddr, clientConn, *cipherEntry, payload, &proxyMetrics)
208+
return cipherEntry.ID, clientInfo, proxyMetrics, err
200209
}
201210

202211
// Given the decrypted contents of a UDP packet, return
203212
// the payload and the destination address, or an error if
204213
// this packet cannot or should not be forwarded.
205-
func (h *packetHandler) validatePacket(textData []byte) ([]byte, *net.UDPAddr, *onet.ConnectionError) {
214+
func (h *packetHandler) getProxyRequest(textData []byte) ([]byte, *net.UDPAddr, *onet.ConnectionError) {
206215
tgtAddr := socks.SplitAddr(textData)
207216
if tgtAddr == nil {
208217
return nil, nil, onet.NewConnectionError("ERR_READ_ADDRESS", "Failed to get target address", nil)
@@ -227,9 +236,7 @@ func isDNS(addr net.Addr) bool {
227236

228237
type natconn struct {
229238
net.PacketConn
230-
cryptoKey *shadowsocks.EncryptionKey
231-
keyID string
232-
clientAddr net.Addr
239+
cryptoKey *shadowsocks.EncryptionKey
233240
// We store the client information in the NAT map to avoid recomputing it
234241
// for every downstream packet in a UDP-based connection.
235242
clientInfo ipinfo.IPInfo
@@ -310,12 +317,9 @@ func (m *natmap) Get(key string) *natconn {
310317
return m.keyConn[key]
311318
}
312319

313-
func (m *natmap) set(clientAddr net.Addr, pc net.PacketConn, cryptoKey *shadowsocks.EncryptionKey, keyID string, clientInfo ipinfo.IPInfo) *natconn {
320+
func (m *natmap) set(clientAddr net.Addr, pc net.PacketConn, clientInfo ipinfo.IPInfo) *natconn {
314321
entry := &natconn{
315322
PacketConn: pc,
316-
cryptoKey: cryptoKey,
317-
keyID: keyID,
318-
clientAddr: clientAddr,
319323
clientInfo: clientInfo,
320324
defaultTimeout: m.timeout,
321325
}
@@ -340,12 +344,12 @@ func (m *natmap) del(key string) net.PacketConn {
340344
}
341345

342346
func (m *natmap) Add(clientAddr net.Addr, clientConn net.PacketConn, cryptoKey *shadowsocks.EncryptionKey, targetConn net.PacketConn, clientInfo ipinfo.IPInfo, keyID string) *natconn {
343-
entry := m.set(clientAddr, targetConn, cryptoKey, keyID, clientInfo)
347+
entry := m.set(clientAddr, targetConn, clientInfo)
344348

345349
m.metrics.AddUDPNatEntry(clientAddr, keyID)
346350
m.running.Add(1)
347351
go func() {
348-
timedCopy(clientAddr, clientConn, entry, keyID, m.metrics)
352+
timedCopy(clientAddr, clientConn, entry, cryptoKey, keyID, m.metrics)
349353
m.metrics.RemoveUDPNatEntry(clientAddr, keyID)
350354
if pc := m.del(clientAddr.String()); pc != nil {
351355
pc.Close()
@@ -375,13 +379,13 @@ var maxAddrLen int = len(socks.ParseAddr("[2001:db8::1]:12345"))
375379

376380
// copy from target to client until read timeout
377381
func timedCopy(clientAddr net.Addr, clientConn net.PacketConn, targetConn *natconn,
378-
keyID string, sm UDPMetrics) {
382+
cryptoKey *shadowsocks.EncryptionKey, keyID string, sm UDPMetrics) {
379383
// pkt is used for in-place encryption of downstream UDP packets, with the layout
380384
// [padding?][salt][address][body][tag][extra]
381385
// Padding is only used if the address is IPv4.
382386
pkt := make([]byte, serverUDPBufferSize)
383387

384-
saltSize := targetConn.cryptoKey.SaltSize()
388+
saltSize := cryptoKey.SaltSize()
385389
// Leave enough room at the beginning of the packet for a max-length header (i.e. IPv6).
386390
bodyStart := saltSize + maxAddrLen
387391

@@ -425,7 +429,7 @@ func timedCopy(clientAddr net.Addr, clientConn net.PacketConn, targetConn *natco
425429
// [ packBuf ]
426430
// [ buf ]
427431
packBuf := pkt[saltStart:]
428-
buf, err := shadowsocks.Pack(packBuf, plaintextBuf, targetConn.cryptoKey) // Encrypt in-place
432+
buf, err := shadowsocks.Pack(packBuf, plaintextBuf, cryptoKey) // Encrypt in-place
429433
if err != nil {
430434
return onet.NewConnectionError("ERR_PACK", "Failed to pack data to client", err)
431435
}
@@ -456,7 +460,7 @@ var _ UDPMetrics = (*NoOpUDPMetrics)(nil)
456460
func (m *NoOpUDPMetrics) GetIPInfo(net.IP) (ipinfo.IPInfo, error) {
457461
return ipinfo.IPInfo{}, nil
458462
}
459-
func (m *NoOpUDPMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, clientProxyBytes, proxyTargetBytes int) {
463+
func (m *NoOpUDPMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, data metrics.ProxyMetrics) {
460464
}
461465
func (m *NoOpUDPMetrics) AddUDPPacketFromTarget(clientInfo ipinfo.IPInfo, accessKey, status string, targetProxyBytes, proxyClientBytes int) {
462466
}

service/udp_test.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/Jigsaw-Code/outline-sdk/transport/shadowsocks"
2727
"github.com/Jigsaw-Code/outline-ss-server/ipinfo"
2828
onet "github.com/Jigsaw-Code/outline-ss-server/net"
29+
"github.com/Jigsaw-Code/outline-ss-server/service/metrics"
2930
logging "github.com/op/go-logging"
3031
"github.com/shadowsocks/go-shadowsocks2/socks"
3132
"github.com/stretchr/testify/assert"
@@ -93,9 +94,9 @@ func (conn *fakePacketConn) Close() error {
9394
}
9495

9596
type udpReport struct {
96-
clientInfo ipinfo.IPInfo
97-
accessKey, status string
98-
clientProxyBytes, proxyTargetBytes int
97+
clientInfo ipinfo.IPInfo
98+
accessKey, status string
99+
data metrics.ProxyMetrics
99100
}
100101

101102
// Stub metrics implementation for testing NAT behaviors.
@@ -109,8 +110,8 @@ var _ UDPMetrics = (*natTestMetrics)(nil)
109110
func (m *natTestMetrics) GetIPInfo(net.IP) (ipinfo.IPInfo, error) {
110111
return ipinfo.IPInfo{}, nil
111112
}
112-
func (m *natTestMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, clientProxyBytes, proxyTargetBytes int) {
113-
m.upstreamPackets = append(m.upstreamPackets, udpReport{clientInfo, accessKey, status, clientProxyBytes, proxyTargetBytes})
113+
func (m *natTestMetrics) AddUDPPacketFromClient(clientInfo ipinfo.IPInfo, accessKey, status string, data metrics.ProxyMetrics) {
114+
m.upstreamPackets = append(m.upstreamPackets, udpReport{clientInfo, accessKey, status, data})
114115
}
115116
func (m *natTestMetrics) AddUDPPacketFromTarget(clientInfo ipinfo.IPInfo, accessKey, status string, targetProxyBytes, proxyClientBytes int) {
116117
}
@@ -178,7 +179,7 @@ func TestIPFilter(t *testing.T) {
178179

179180
assert.Equal(t, 2, len(metrics.upstreamPackets), "Expected 2 reports, not %v", metrics.upstreamPackets)
180181
for _, report := range metrics.upstreamPackets {
181-
assert.Greater(t, report.proxyTargetBytes, 0, "Expected nonzero bytes to be sent for allowed packet")
182+
assert.Greater(t, int(report.data.ProxyTarget), 0, "Expected nonzero bytes to be sent for allowed packet")
182183
}
183184
})
184185

@@ -187,7 +188,7 @@ func TestIPFilter(t *testing.T) {
187188

188189
assert.Equal(t, 2, len(metrics.upstreamPackets), "Expected 2 reports, not %v", metrics.upstreamPackets)
189190
for _, report := range metrics.upstreamPackets {
190-
assert.Equal(t, 0, report.proxyTargetBytes, "No bytes should be sent due to a disallowed packet")
191+
assert.EqualValues(t, 0, report.data.ProxyTarget, "No bytes should be sent due to a disallowed packet")
191192
}
192193
})
193194
}
@@ -197,13 +198,13 @@ func TestNATEntries(t *testing.T) {
197198
payloads := [][]byte{[]byte("payload1"), []byte("payload2")}
198199

199200
t.Run("Valid cipher", func(t *testing.T) {
200-
metrics := sendToDiscardWithValidCipher(payloads, onet.RequirePublicIP)
201+
metrics := sendToDiscardWithValidCipher(payloads, allowAll)
201202

202203
assert.Equal(t, 1, metrics.natEntriesAdded, "Expected 1 NAT entry, not %d", metrics.natEntriesAdded)
203204
})
204205

205206
t.Run("Invalid cipher", func(t *testing.T) {
206-
metrics := sendToDiscardWithInValidCipher(payloads, onet.RequirePublicIP)
207+
metrics := sendToDiscardWithInValidCipher(payloads, allowAll)
207208

208209
assert.Equal(t, 0, metrics.natEntriesAdded, "Unexpected NAT entry on rejected packet")
209210
})
@@ -221,8 +222,8 @@ func TestUpstreamMetrics(t *testing.T) {
221222

222223
assert.Equal(t, N, len(metrics.upstreamPackets), "Expected %d reports, not %v", N, metrics.upstreamPackets)
223224
for i, report := range metrics.upstreamPackets {
224-
assert.Equal(t, i+1, report.proxyTargetBytes, "Expected %d payload bytes, not %d", i+1, report.proxyTargetBytes)
225-
assert.Greater(t, report.clientProxyBytes, report.proxyTargetBytes, "Expected nonzero input overhead (%d > %d)", report.clientProxyBytes, report.proxyTargetBytes)
225+
assert.EqualValues(t, i+1, report.data.ProxyTarget, "Expected %d payload bytes, not %d", i+1, report.data.ProxyTarget)
226+
assert.Greater(t, report.data.ClientProxy, report.data.ProxyTarget, "Expected nonzero input overhead (%d > %d)", report.data.ClientProxy, report.data.ProxyTarget)
226227
assert.Equal(t, "id-0", report.accessKey, "Unexpected access key name: %s", report.accessKey)
227228
assert.Equal(t, "OK", report.status, "Wrong status: %s", report.status)
228229
}

0 commit comments

Comments
 (0)