Tcp buffer bug fix (#79)

* start working on tracking down tcp buffer bug

* mtu refactor

* modularize test

* more precise testing

* tests fail, but is it the failure we are looking for?

* fix typo in espradio link (#76)

* implement a new backoff abstraction (#75)

* rewrite backoff api

* rewrite tcp.Conn.Write

* keep fixing small things

* much better Conn.Read implementation

* fix critical overflow bug in internal.ConnRWBackoff

---------

Co-authored-by: Joel Wetzell <jwetzell@yahoo.com>
This commit is contained in:
Pat Whittingslow
2026-04-14 19:11:29 -03:00
committed by GitHub
parent 5bde7a9979
commit 75a812a8d7
22 changed files with 354 additions and 109 deletions
+5 -4
View File
@@ -5,12 +5,13 @@ import (
"testing"
"time"
"github.com/soypat/lneto/ethernet"
"github.com/soypat/lneto/tcp"
)
func TestTCPConn_SetDeadline_Established(t *testing.T) {
const seed = 9999
const MTU = 1500
const MTU = ethernet.MaxMTU
const svPort = 8080
client, sv, clconn, svconn := newTCPStacks(t, seed, MTU)
tst := testerFrom(t, MTU)
@@ -37,7 +38,7 @@ func TestTCPConn_SetDeadline_Established(t *testing.T) {
func TestTCPConn_ReadDeadlineExceeded(t *testing.T) {
const seed = 10001
const MTU = 1500
const MTU = ethernet.MaxMTU
const svPort = 8080
client, sv, clconn, svconn := newTCPStacks(t, seed, MTU)
tst := testerFrom(t, MTU)
@@ -63,7 +64,7 @@ func TestTCPConn_ReadDeadlineExceeded(t *testing.T) {
func TestTCPConn_WriteDeadlineExceeded(t *testing.T) {
const seed = 10002
const MTU = 1500
const MTU = ethernet.MaxMTU
const svPort = 8080
client, sv, clconn, svconn := newTCPStacks(t, seed, MTU)
tst := testerFrom(t, MTU)
@@ -88,7 +89,7 @@ func TestTCPConn_WriteDeadlineExceeded(t *testing.T) {
func TestTCPConn_FlushEmptyNoop(t *testing.T) {
const seed = 10003
const MTU = 1500
const MTU = ethernet.MaxMTU
const svPort = 8080
client, sv, clconn, svconn := newTCPStacks(t, seed, MTU)
tst := testerFrom(t, MTU)