commit 5df02e0d8d9027c56450c94857949b3826454369 from: Omar Polo date: Tue Jan 11 15:34:04 2022 UTC fix start_loading_animation usage the idiom if (load_next_page(...)) start_loading_anim(...); is fundamentally wrong because `load_next_page' (or previous page, or anything else that call into load_url) *may* load all the page before returning (thanks to the cache, but not only, cf. load_page_from_str.) Instead, let's call start_loadign_anim at the start of make_request so it's always called in the right moment. Cache and other special pages don't end up calling make_request anyway, and we already call stop_loading_anim when a request finishes (or fails.) move start_loading_anim up in make_request. commit - ed21a9a1021f38c009ef8a0ea6049587e3b4373b commit + 5df02e0d8d9027c56450c94857949b3826454369 blob - 8a1d6d723da36ee7816a2f9dcc0644c5ba32f5f1 blob + 40def3c21d3ee0972bbda48f6fd9e3ed475b5ce9 --- cmd.c +++ cmd.c @@ -409,8 +409,6 @@ cmd_previous_page(struct buffer *buffer) { if (!load_previous_page(current_tab)) message("No previous page"); - else - start_loading_anim(current_tab); } void @@ -418,8 +416,6 @@ cmd_next_page(struct buffer *buffer) { if (!load_next_page(current_tab)) message("No next page"); - else - start_loading_anim(current_tab); } void blob - 7fcf75cf637f7bfe42ea3a20143de5c27bd7d479 blob + c58ab78a40612c01cb3d9532f56b7efc65bce35e --- telescope.c +++ telescope.c @@ -842,6 +842,7 @@ make_request(struct tab *tab, struct get_req *req, int strlcat(req->req, "\r\n", sizeof(req->req)); } + start_loading_anim(tab); ui_send_net(IMSG_GET_RAW, tab->id, req, sizeof(*req)); /* @@ -871,8 +872,6 @@ gopher_send_search_req(struct tab *tab, const char *te { struct get_req req; - start_loading_anim(tab); - memset(&req, 0, sizeof(req)); strlcpy(req.host, tab->uri.host, sizeof(req.host)); strlcpy(req.port, tab->uri.port, sizeof(req.port)); @@ -933,7 +932,6 @@ do_load_url(struct tab *tab, const char *url, const ch char *t; tab->proxy = NULL; - tab->trust = TS_UNKNOWN; if (base == NULL) @@ -1021,7 +1019,6 @@ load_url_in_tab(struct tab *tab, const char *url, cons autosave_hook(); message("Loading %s...", url); - start_loading_anim(tab); load_url(tab, url, base, mode); }