diff options
author | Ashish Gupta <ashmew2@gmail.com> | 2017-10-08 16:40:48 +0200 |
---|---|---|
committer | Ashish Gupta <ashmew2@gmail.com> | 2017-10-25 22:04:55 +0200 |
commit | 7d12ce9e6a2dd795c8dcdf94af37219ac94e9dde (patch) | |
tree | 8659ed41e6820e21cf751e21011edfd016cc88fd | |
parent | 48182ca52b9faadefe2e04e693ebdaff0014cb85 (diff) | |
download | netsurf-7d12ce9e6a2dd795c8dcdf94af37219ac94e9dde.tar.gz netsurf-7d12ce9e6a2dd795c8dcdf94af37219ac94e9dde.tar.bz2 |
Free the fetch (and http.obj handle) when errored out or finished or aborted
-rw-r--r-- | content/fetchers/httplib_kolibri.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/content/fetchers/httplib_kolibri.c b/content/fetchers/httplib_kolibri.c index f9a0d9531..1aae7e583 100644 --- a/content/fetchers/httplib_kolibri.c +++ b/content/fetchers/httplib_kolibri.c @@ -268,14 +268,17 @@ bool start_fetch(void *httpf) { bool abort_fetch(void *httpf) { LOG("aborting fetch 0x%x", ((struct httpfetcher *)httpf)->owner); - http_disconnect_asm(((struct httpfetcher *)httpf)->handle); remove_from_poll(((struct httpfetcher *) httpf)->handle); fetch_remove_from_queues(((struct httpfetcher *)httpf)->owner); - /* fetch_free(((struct httpfetcher *)httpf)->owner); */ + fetch_free(((struct httpfetcher *)httpf)->owner); return true; } bool free_fetch(void *httpf) { + LOG("free_fetch called for 0x%x", ((struct httpfetcher *)httpf)->owner); + debug_board_printf("Closing http connection in free_fetch\n"); + http_disconnect_asm((((struct httpfetcher *)httpf)->handle)); + LOG("Freeing fetch 0x%x", ((struct httpfetcher *)httpf)->owner); http_free_asm((((struct httpfetcher *)httpf)->handle)); free((struct httpfetcher *)httpf); @@ -384,7 +387,7 @@ void poll_fetch(lwc_string *scheme) { t->headercbdone = true; remove_from_poll(t->handle); fetch_remove_from_queues(t->owner); - /* fetch_free(t->owner); */ + fetch_free(t->owner); /* t = t->next; */ t = head; continue; @@ -429,7 +432,7 @@ void poll_fetch(lwc_string *scheme) { struct httpfetcher *tnext = t->next; remove_from_poll(t->handle); fetch_remove_from_queues(t->owner); - /* fetch_free(t->owner); */ + fetch_free(t->owner); t = head; /* t = tnext; */ continue; |