[PATCH] tools: usb: p9_fwd: Send complete requests to the TCP server

From: Zhu Jun

Date: Fri Nov 20 2026 - 01:19:50 EST


socket.send() can return after sending only a prefix of a request.
The forwarder ignores that result and waits for a response to an
incomplete message. Use sendall() so request forwarding completes
only once all bytes have been sent or a write error is reported.

Fixes: 673f0c3ffc75 ("tools: usb: p9_fwd: add usb gadget packet forwarder script")
Signed-off-by: Zhu Jun <zhujun2@xxxxxxxxxxxxxxxxxxxx>
---
tools/usb/p9_fwd.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/usb/p9_fwd.py b/tools/usb/p9_fwd.py
index 12c76cbb046b..d5ffb2f0c5ab 100755
--- a/tools/usb/p9_fwd.py
+++ b/tools/usb/p9_fwd.py
@@ -124,7 +124,7 @@ class Forwarder:
data += self.ep_in.read(size - len(data))
logging.log(logging.TRACE, "c2s: writing")
self._log_hexdump(data)
- self.s.send(data)
+ self.s.sendall(data)
logging.debug("c2s: forwarded %i bytes", size)
self.stats["c2s packets"] += 1
self.stats["c2s bytes"] += size