mirror of
https://github.com/pissnet/pissircd.git
synced 2025-08-07 18:55:23 +01:00
When using remote includes with certain setups, one could get weird
rehash errors such as error: set::geoip-classic::ipv6-database: cannot open file "/home/xxxx/unrealircd/data/https://www.unrealircd... and possibly even a crash. The initial boot of UnrealIRCd, however, was always fine, this only happened when rehashing. It also seemed to occur more with ftp:// includes or at least with multiple parallel includes, that may or may not have different or more latency. In any case it seemed to affect some remote includes setups semi-consistently, and others not at all. The root cause was a complex code path causing a read-after-free. We now use a simplified code path which can no longer cause this. The only downside is that rehashing may be delayed up to an extra 250ms (quarter of a second), but that should hardly be noticeable, if at all. Issue reported by Bun-Bun.
This commit is contained in:
parent
8fe44698df
commit
e0cfbe5821
3 changed files with 4 additions and 7 deletions
|
@ -518,6 +518,7 @@ extern int channel_canjoin(Client *client, const char *name);
|
|||
extern char *collapse(char *pattern);
|
||||
extern void dcc_sync(Client *client);
|
||||
extern void request_rehash(Client *client);
|
||||
extern int rehash_internal(Client *client);
|
||||
extern void s_die();
|
||||
extern int match_simple(const char *mask, const char *name);
|
||||
extern int match_esc(const char *mask, const char *name);
|
||||
|
|
|
@ -10638,13 +10638,6 @@ void resource_download_complete(const char *url, const char *file, const char *e
|
|||
safe_strdup(wce->ce->value, rs->file); // now information of url is lost, hm!!
|
||||
}
|
||||
}
|
||||
|
||||
/* If rehashing, check if we are done.
|
||||
* If booting (not rehashing), this is done from the
|
||||
* startup loop where it also checks is_config_read_finished().
|
||||
*/
|
||||
if (loop.rehashing && is_config_read_finished())
|
||||
rehash_internal(loop.rehash_save_client);
|
||||
}
|
||||
|
||||
/** Request to REHASH the configuration file.
|
||||
|
|
|
@ -914,6 +914,9 @@ void SocketLoop(void *dummy)
|
|||
reinit_tls();
|
||||
doreloadcert = 0;
|
||||
}
|
||||
/* If rehashing, check if we are done. */
|
||||
if (loop.rehashing && is_config_read_finished())
|
||||
rehash_internal(loop.rehash_save_client);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue