pull: Correctly handle error state when fetching optional data

For the static deltas work, we're using the already-extant internal
API to perform a HTTP fetch for optional data - static deltas are
optional.

Except that we didn't correctly unset the error if we were doing an
optional fetch and the data wasn't found.
This commit is contained in:
Colin Walters 2014-04-29 09:02:43 -04:00
parent 626fc8519b
commit 7cc4a20f3b
1 changed files with 7 additions and 4 deletions

View File

@ -293,11 +293,14 @@ fetch_uri_contents_membuf_sync (OtPullData *pull_data,
run_mainloop_monitor_fetcher (pull_data); run_mainloop_monitor_fetcher (pull_data);
if (!fetch_data.result_stream) if (!fetch_data.result_stream)
{ {
if (allow_noent && g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) if (allow_noent)
{ {
g_clear_error (error); if (g_error_matches (*error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
ret = TRUE; {
*out_contents = NULL; g_clear_error (error);
ret = TRUE;
*out_contents = NULL;
}
} }
goto out; goto out;
} }