aboutsummaryrefslogtreecommitdiff
path: root/test_p2p_stress
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2019-06-11 20:14:51 -0400
committerDeterminant <tederminant@gmail.com>2019-06-11 20:14:51 -0400
commit40d830a4a3e225ea8819251c7c87a66eab0d46d0 (patch)
treefadd94d4d92049712bb94fd1a5bd82bba60c78ed /test_p2p_stress
parent13630c375090079bbfb5129c4adcd53e04e19dd9 (diff)
fix conn bug
Diffstat (limited to 'test_p2p_stress')
-rw-r--r--test_p2p_stress/main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/test_p2p_stress/main.go b/test_p2p_stress/main.go
index ed671fc..ff7bd47 100644
--- a/test_p2p_stress/main.go
+++ b/test_p2p_stress/main.go
@@ -194,9 +194,10 @@ func onReceiveAck(_msg *C.struct_msg_t, _conn *C.struct_msgnetwork_conn_t, userd
ctx := C.timeout_callback_context_new()
ctx.app_id = C.int(id)
ctx.addr_id = C.uint64_t(addr)
- ctx.conn = (*C.struct_msgnetwork_conn_t)(conn)
+ ctx.conn = (*C.struct_msgnetwork_conn_t)(conn.Copy())
if tc.timer != nil {
tc.timer.Free()
+ salticidae.MsgNetworkConn(tc.timer_ctx.conn).Free()
C.free(unsafe.Pointer(tc.timer_ctx))
}
tc.timer = salticidae.NewTimerEvent(app.ec, salticidae.TimerEventCallback(C.onTimeout), unsafe.Pointer(ctx))