Commit 48a9850
committed
EC: forward CLibSocket::OnLost to CECSocket::OnLost so EOF actually flips the UI
CECMuleSocket multi-inherits from CECSocket (EC protocol layer) and
CLibSocket (transport layer). Both declare `virtual void OnLost()`
with identical signature, so they live in separate vtables in the
combined object and there's no shared override. The Asio reactor's
HandleRead (LibSocketAsio.cpp) calls socket->OnLost() through the
CLibSocket vtable on EOF / peer-FIN — but that vtable slot is the
empty CLibSocket::OnLost(){} default, because nothing was overriding
the LibSocket-side virtual. CRemoteConnect::OnLost and
CECServerSocket::OnLost (the ones that actually flip the GUI to
disconnected and release server-side state) override the *CECSocket*
side and never get called from the Asio path.
End result on the wire: amuled closes the EC socket, amulegui /
amuleweb's kernel receives FIN and parks the socket in CLOSE_WAIT,
the Asio reactor reports EOF, dispatch lands in the empty stub, and
the client process happily sits "connected" forever. Verified live
on a Linux VM in this branch's previous keepalive-only commit — the
TCP-layer teardown via keepalive eventually fires (~60s) but
application-level state never reacts.
Fix mirrors the existing OnConnect(int) pattern in CECMuleSocket:
disambiguate by signature.
* CLibSocket::OnLost() → OnLost(int) (param ignored, exists only to
give the LibSocket-side virtual a different signature from the
EC-side one).
* LibSocketAsio.cpp dispatch updated to call OnLost(0).
* CWebSocket::OnLost overrides on the new signature (amuleweb's
HTTP-side socket inherits CLibSocket directly so this is the right
hook there).
* New CECMuleSocket::OnLost(int) forwards to CECSocket::OnLost()
through a static_cast<CECSocket*>(this) call so virtual dispatch
finds the most-derived override (CRemoteConnect on amulegui /
amuleweb's EC side, CECServerSocket on amuled).
Refs amule-project#757.1 parent 1010338 commit 48a9850
5 files changed
Lines changed: 24 additions & 4 deletions
File tree
- src
- libs/ec/cpp
- webserver/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1772 | 1772 | | |
1773 | 1773 | | |
1774 | 1774 | | |
1775 | | - | |
| 1775 | + | |
1776 | 1776 | | |
1777 | 1777 | | |
1778 | 1778 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
0 commit comments