commit - 338eecdc86d1e915f8d3180896a45cb33a804434
commit + 1b8a4bbf297ad87bd077ec80121218ab2c8823fb
blob - b392356c4cd1a33bd39de6f051850671e5f64254
blob + 5a7d85f8cd585912bde5e691d7b840b2837fa8d0
--- telescope.c
+++ telescope.c
{ NULL, NULL },
};
-static struct imsgbuf *ibuf;
+static struct imsgbuf *netibuf;
static void handle_imsg_err(struct imsg*, size_t);
static void handle_imsg_check_cert(struct imsg*, size_t);
{
int tofu_res = 1;
- imsg_compose(ibuf, IMSG_CERT_STATUS, imsg->hdr.peerid, 0, -1, &tofu_res, sizeof(tofu_res));
- imsg_flush(ibuf);
+ imsg_compose(netibuf, IMSG_CERT_STATUS, imsg->hdr.peerid, 0, -1, &tofu_res, sizeof(tofu_res));
+ imsg_flush(netibuf);
}
static inline int
ui_require_input(tab, tab->code == 11);
} else if (tab->code == 20) {
if (setup_parser_for(tab)) {
- imsg_compose(ibuf, IMSG_PROCEED, tab->id, 0, -1, NULL, 0);
- imsg_flush(ibuf);
+ imsg_compose(netibuf, IMSG_PROCEED, tab->id, 0, -1, NULL, 0);
+ imsg_flush(netibuf);
} else {
load_page_from_str(tab, err_pages[UNKNOWN_TYPE_OR_CSET]);
}
size_t datalen;
ssize_t n;
- if ((n = imsg_read(ibuf)) == -1) {
+ if ((n = imsg_read(netibuf)) == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
return;
die();
}
for (;;) {
- if ((n = imsg_get(ibuf, &imsg)) == -1)
+ if ((n = imsg_get(netibuf, &imsg)) == -1)
die();
if (n == 0)
return;
}
url_unparse(&tab->url, tab->urlstr, sizeof(tab->urlstr));
- imsg_compose(ibuf, IMSG_GET, tab->id, 0, -1,
+ imsg_compose(netibuf, IMSG_GET, tab->id, 0, -1,
tab->urlstr, strlen(tab->urlstr)+1);
- imsg_flush(ibuf);
+ imsg_flush(netibuf);
return;
err:
void
stop_tab(struct tab *tab)
{
- imsg_compose(ibuf, IMSG_STOP, tab->id, 0, -1, NULL, 0);
- imsg_flush(ibuf);
+ imsg_compose(netibuf, IMSG_STOP, tab->id, 0, -1, NULL, 0);
+ imsg_flush(netibuf);
}
int
close(imsg_fds[1]);
imsg_init(&main_ibuf, imsg_fds[0]);
- ibuf = &main_ibuf;
+ netibuf = &main_ibuf;
TAILQ_INIT(&tabshead);
event_init();
- event_set(&imsgev, ibuf->fd, EV_READ | EV_PERSIST, dispatch_imsg, ibuf);
+ event_set(&imsgev, netibuf->fd, EV_READ | EV_PERSIST, dispatch_imsg, netibuf);
event_add(&imsgev, NULL);
ui_init();
event_dispatch();
- imsg_compose(ibuf, IMSG_QUIT, 0, 0, -1, NULL, 0);
- imsg_flush(ibuf);
+ imsg_compose(netibuf, IMSG_QUIT, 0, 0, -1, NULL, 0);
+ imsg_flush(netibuf);
ui_end();