Skip to content

fix h2mux RST_STREAM on half-close#8

Merged
nekohasekai merged 1 commit intoSagerNet:mainfrom
cfal:main
Jan 16, 2026
Merged

fix h2mux RST_STREAM on half-close#8
nekohasekai merged 1 commit intoSagerNet:mainfrom
cfal:main

Conversation

@cfal
Copy link
Copy Markdown
Contributor

@cfal cfal commented Dec 29, 2025

h2mux connections send RST_STREAM(CANCEL) instead of END_STREAM when the client finishes uploading data.

a repro is at https://gist.github.com/cfal/4eb8b86283ef896046fe00bda50d161f and can be run with go test -v -run TestSingboxH2MuxLargeTransfer

before:

+0400 2025-12-29 12:07:39 INFO [4108311949 0ms] inbound/vless[vless-in]: [0] inbound connection to sp.mux.sing-box.arpa:444
    singbox_h2mux_test.go:152: SOCKS5 connected to echo server                
    singbox_h2mux_test.go:160: Sending 65536 bytes...                                   
    singbox_h2mux_test.go:167: Closing write side (shutdown)...                                                                                                                        
    singbox_h2mux_test.go:171: Waiting for echo response...
+0400 2025-12-29 12:07:39 DEBUG [3568073759 1ms] connection: connection upload finished
    singbox_h2mux_test.go:188: Received 0 bytes 

after:

+0400 2025-12-29 12:10:43 DEBUG [2274972886 1ms] connection: connection upload finished
+0400 2025-12-29 12:10:43 DEBUG [272648898 0ms] connection: connection upload finished
    singbox_h2mux_test.go:218: Echo server: received 65536 bytes, echoing back
+0400 2025-12-29 12:10:43 DEBUG [272648898 1ms] connection: connection download finished
+0400 2025-12-29 12:10:43 DEBUG [2274972886 3ms] connection: connection download finished
    singbox_h2mux_test.go:188: Received 65536 bytes

@nekohasekai nekohasekai merged commit 63fb8de into SagerNet:main Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants