SpoofDPI: fix https-proxy premature connection close
This commit is contained in:
31
SpoofDPI/8a370430c7d855a63d15337e9781933f6e55707f.patch
Normal file
31
SpoofDPI/8a370430c7d855a63d15337e9781933f6e55707f.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
From 8a370430c7d855a63d15337e9781933f6e55707f Mon Sep 17 00:00:00 2001
|
||||
From: Andrey Semenov <semenov.ao@greendatasoft.ru>
|
||||
Date: Thu, 19 Sep 2024 17:32:37 +0500
|
||||
Subject: [PATCH] fix: write to lConn even if any error met and some bytes was
|
||||
read
|
||||
|
||||
---
|
||||
proxy/handler/https.go | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/proxy/handler/https.go b/proxy/handler/https.go
|
||||
index f709925..bc320fd 100644
|
||||
--- a/proxy/handler/https.go
|
||||
+++ b/proxy/handler/https.go
|
||||
@@ -2,7 +2,6 @@ package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
- "errors"
|
||||
"io"
|
||||
"net"
|
||||
"regexp"
|
||||
@@ -134,7 +133,7 @@ func (h *HttpsHandler) communicate(ctx context.Context, from *net.TCPConn, to *n
|
||||
|
||||
bytesRead, err := ReadBytes(ctx, from, buf)
|
||||
if err != nil {
|
||||
- if errors.Is(err, io.EOF) && len(bytesRead) > 0 {
|
||||
+ if len(bytesRead) > 0 {
|
||||
h.write(logger, td, to, bytesRead)
|
||||
}
|
||||
logger.Debug().Msgf("error reading from %s: %s", fd, err)
|
||||
Reference in New Issue
Block a user