commit f6a429ebe5c3de47bf096be801998fb6d09e6a73 from: Omar Polo date: Sat Jul 10 18:33:36 2021 UTC initialize tabshead and proxylist early after the re-exec diff, the configuration gets loaded *before* and then the proxy list is initialized. Thus once we start the UI the proxy list is always empty. Solve the headaches by using TAILQ_HEAD_INITIALIZER. Or, in theory we could also avoid the initialization at all, since globals vars should be zeroed. commit - 8a7f2683ba78ca71cef37cae58db7de52b87f83e commit + f6a429ebe5c3de47bf096be801998fb6d09e6a73 blob - 1e9b1046ee0786259437ad3757cd7caa436e1505 blob + 0d786afb61e9e16a2e975bb6e4ed4568e6eba25a --- telescope.c +++ telescope.c @@ -11,8 +11,8 @@ #include struct event netev, fsev; -struct tabshead tabshead; -struct proxylist proxies; +struct tabshead tabshead = TAILQ_HEAD_INITIALIZER(tabshead); +struct proxylist proxies = TAILQ_HEAD_INITIALIZER(proxies); enum telescope_process { PROC_UI, @@ -835,9 +835,6 @@ main(int argc, char * const *argv) tofu_init(&certs, 5, offsetof(struct tofu_entry, domain)); load_certs(&certs); - TAILQ_INIT(&tabshead); - TAILQ_INIT(&proxies); - event_init(); event_set(&netev, netibuf->fd, EV_READ | EV_PERSIST,