[grits] Misc http fixes
- From: Andy Spencer <andys src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grits] Misc http fixes
- Date: Fri, 17 Jun 2011 05:20:29 +0000 (UTC)
commit 92446ae87f720e43bd0e2239a7eb5036d6fb416b
Author: Andy Spencer <andy753421 gmail com>
Date: Tue May 24 06:01:36 2011 +0000
Misc http fixes
Caching still doesn't work, but it appears to be a server problem.
src/data/grits-http.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/data/grits-http.c b/src/data/grits-http.c
index 943441d..8f4cfe4 100644
--- a/src/data/grits-http.c
+++ b/src/data/grits-http.c
@@ -178,7 +178,8 @@ gchar *grits_http_fetch(GritsHttp *http, const gchar *uri, const char *local,
if (message == NULL)
g_error("message is null, cannot parse uri");
g_signal_connect(message, "got-chunk", G_CALLBACK(_chunk_cb), &info);
- soup_message_headers_set_range(message->request_headers, ftell(fp), -1);
+ //if (ftell(fp) > 0)
+ soup_message_headers_set_range(message->request_headers, ftell(fp), -1);
if (mode == GRITS_REFRESH)
soup_message_headers_replace(message->request_headers,
"Cache-Control", "max-age=0");
@@ -192,7 +193,9 @@ gchar *grits_http_fetch(GritsHttp *http, const gchar *uri, const char *local,
}
/* Finished */
- if (message->status_code == 416) {
+ if (message->status_code == SOUP_STATUS_CANCELLED) {
+ return NULL;
+ } else if (message->status_code == SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE) {
/* Range unsatisfiable, file already complete */
} else if (!SOUP_STATUS_IS_SUCCESSFUL(message->status_code)) {
g_warning("GritsHttp: done_cb - error copying file, status=%d\n"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]