X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fdata%2Fgis-http.c;h=b5259e47108e15a92f0f95b44c24d4b19828a873;hp=613dd439fa7ce38f7c55486415cf5a1a8cc8d15a;hb=e7127ea74717754c48779467aca2f9a1596a99f0;hpb=ea8ac9ebb3309b84bed137bb3ff59926c23216ce diff --git a/src/data/gis-http.c b/src/data/gis-http.c index 613dd43..b5259e4 100644 --- a/src/data/gis-http.c +++ b/src/data/gis-http.c @@ -125,7 +125,6 @@ gchar *gis_http_fetch(GisHttp *http, const gchar *uri, const char *local, { g_debug("GisHttp: fetch - %s... >> %s/%s mode=%d", uri, http->prefix, local, mode); - gchar *path = _get_cache_path(http, local); /* Unlink the file if we're refreshing it */ @@ -141,7 +140,8 @@ gchar *gis_http_fetch(GisHttp *http, const gchar *uri, const char *local, gchar *part = path; if (!g_file_test(path, G_FILE_TEST_EXISTS)) part = g_strdup_printf("%s.part", path); - FILE *fp = fopen_p(part, "a"); + FILE *fp = fopen_p(part, "ab"); + fseek(fp, 0, SEEK_END); // "a" is broken on Windows, twice /* Make temp data */ struct _CacheInfo info = { @@ -178,6 +178,7 @@ gchar *gis_http_fetch(GisHttp *http, const gchar *uri, const char *local, } } + /* TODO: free everything.. */ return path; } @@ -219,7 +220,6 @@ GList *gis_http_available(GisHttp *http, g_free(path); } - /* Add online files if online */ if (index) { gchar tmp[16];