Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 487bbd5

Browse files
wimspaargarenWim SpaargarenTakeshi Yoneda
authored
chore: correctly clear context when proxy is done (#86)
* chore: correctly clear context when proxy is done * Update proxywasm/abi_lifecycle.go Co-authored-by: Takeshi Yoneda <[email protected]> * Update proxywasm/abi_lifecycle.go Co-authored-by: Takeshi Yoneda <[email protected]> * Update proxywasm/abi_lifecycle.go Co-authored-by: Takeshi Yoneda <[email protected]> Co-authored-by: Wim Spaargaren <[email protected]> Co-authored-by: Takeshi Yoneda <[email protected]>
1 parent 70d1e94 commit 487bbd5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

proxywasm/abi_lifecycle.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,19 @@ func proxyOnContextCreate(contextID uint32, rootContextID uint32) {
3131
func proxyOnDone(contextID uint32) bool {
3232
if ctx, ok := currentState.streams[contextID]; ok {
3333
currentState.setActiveContextID(contextID)
34+
delete(currentState.streams, contextID)
3435
ctx.OnStreamDone()
3536
return true
3637
} else if ctx, ok := currentState.httpStreams[contextID]; ok {
3738
currentState.setActiveContextID(contextID)
3839
ctx.OnHttpStreamDone()
40+
delete(currentState.httpStreams, contextID)
3941
return true
4042
} else if ctx, ok := currentState.rootContexts[contextID]; ok {
4143
currentState.setActiveContextID(contextID)
42-
return ctx.context.OnVMDone()
44+
response := ctx.context.OnVMDone()
45+
delete(currentState.rootContexts, contextID)
46+
return response
4347
} else {
4448
panic("invalid context on proxy_on_done")
4549
}

0 commit comments

Comments
 (0)