mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
unlink detection rewrite - please test this
This commit is contained in:
parent
6b8e138eb4
commit
b4867481f4
7 changed files with 70 additions and 36 deletions
|
@ -183,9 +183,14 @@ int disconnected(string remaining) {
|
|||
#endif
|
||||
// wow.. a sincerely expected disconnect!
|
||||
if (flags & TCP_PENDING_DISCONNECT) return 1;
|
||||
#ifdef _flag_enable_report_failure_network_circuit_disconnect
|
||||
monitor_report("_failure_network_circuit_disconnect",
|
||||
object_name(ME) +" · lost PSYC circuit");
|
||||
return 0; // unexpected
|
||||
#else
|
||||
P1(("%O disconnected unexpectedly\n", ME))
|
||||
#endif
|
||||
return 0; // unexpected
|
||||
|
||||
}
|
||||
|
||||
// respond to the first empty packet
|
||||
|
|
|
@ -15,7 +15,7 @@ inherit NET_PATH "spyc/circuit";
|
|||
// keep a list of objects to ->disconnected() when the driver tells us
|
||||
volatile array(object) disconnect_notifies;
|
||||
|
||||
void do_notify_on_disconnect(object user) {
|
||||
void register_link(object user) {
|
||||
unless(disconnect_notifies)
|
||||
disconnect_notifies = ({ });
|
||||
disconnect_notifies += ({ user });
|
||||
|
@ -54,7 +54,7 @@ disconnected(remaining) {
|
|||
// emulate disconnect() for net/psyc/user
|
||||
if (disconnect_notifies) {
|
||||
foreach (object t : disconnect_notifies)
|
||||
if (t) t->disconnected();
|
||||
if (t) t->link_disconnected();
|
||||
}
|
||||
rc = ::disconnected(remaining);
|
||||
destruct(ME);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue