fetch: isolate the close code in a callback
modified libpkg/fetch.c
@@ -1,5 +1,5 @@
|
|
| - | |
| + | |
|
|
|
|
|
@@ -52,30 +52,37 @@ static struct fetcher fetchers [] = {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -176,8 +183,6 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest,
|
|
|
|
|
|
| - | |
| - | |
|
|
|
|
|
@@ -253,7 +258,6 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest,
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -277,7 +281,7 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -302,8 +306,8 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest,
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -321,12 +325,8 @@ cleanup:
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
modified libpkg/fetch_file.c
@@ -1,5 +1,5 @@
|
|
| - | |
| + | |
|
|
|
|
|
@@ -59,3 +59,11 @@ file_open(struct pkg_repo *repo, struct url *u, off_t *sz)
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
modified libpkg/fetch_ssh.c
@@ -99,15 +99,15 @@ tcp_connect(struct pkg_repo *repo, struct url *u)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -119,9 +119,9 @@ tcp_connect(struct pkg_repo *repo, struct url *u)
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -202,13 +202,13 @@ ssh_connect(struct pkg_repo *repo, struct url *u)
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -221,9 +221,9 @@ ssh_connect(struct pkg_repo *repo, struct url *u)
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -240,7 +240,7 @@ pkgprotocol_open(struct pkg_repo *repo, struct url *u, off_t *sz,
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -249,8 +249,8 @@ pkgprotocol_open(struct pkg_repo *repo, struct url *u, off_t *sz,
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -300,7 +300,7 @@ tcp_close(void *data)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -319,7 +319,7 @@ ssh_close(void *data)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified libpkg/private/fetch.h
@@ -1,5 +1,5 @@
|
|
| - | |
| + | |
|
|
|
|
|
@@ -23,12 +23,10 @@
|
|
|
|
|
|
| - | |
| - | |
| + | |
|
|
|
|
|
|
|
|
| + | |
|
|
| - | |
| - | |
modified libpkg/private/pkg.h
@@ -181,6 +181,7 @@ struct url;
|
|
|
|
|
|
| + | |
|
|
|
|
|