diff options
author | Christian Kellner <gicmo@gnome.org> | 2008-02-25 20:04:46 +0000 |
---|---|---|
committer | Christian Kellner <gicmo@src.gnome.org> | 2008-02-25 20:04:46 +0000 |
commit | d966b3ade7d0d864f827417b015251454d96e9e2 (patch) | |
tree | 688e3b273308981e84369b4669b7cc61e8bacde6 /daemon/gvfsbackendhttp.c | |
parent | 0f7e80ff76925963f6efae272c9303a044a52d83 (diff) | |
download | gvfs-d966b3ade7d0d864f827417b015251454d96e9e2.tar.gz |
Initial take on implementing delete.
2008-02-25 Christian Kellner <gicmo@gnome.org>
* daemon/gvfsbackenddav.c:
Initial take on implementing delete.
* daemon/gvfsbackendhttp.c:
* daemon/gvfsbackendhttp.h:
Add http_error_code_from_status helper function.
svn path=/trunk/; revision=1373
Diffstat (limited to 'daemon/gvfsbackendhttp.c')
-rw-r--r-- | daemon/gvfsbackendhttp.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c index 8b2c24b3..40ad4e62 100644 --- a/daemon/gvfsbackendhttp.c +++ b/daemon/gvfsbackendhttp.c @@ -165,6 +165,34 @@ uri_get_basename (const char *uri_str) /* ************************************************************************* */ /* */ +guint +http_error_code_from_status (guint status) +{ + switch (status) { + + case SOUP_STATUS_CANT_RESOLVE: + case SOUP_STATUS_CANT_RESOLVE_PROXY: + return G_IO_ERROR_HOST_NOT_FOUND; + + case SOUP_STATUS_CANCELLED: + return G_IO_ERROR_CANCELLED; + + case SOUP_STATUS_UNAUTHORIZED: + case SOUP_STATUS_PAYMENT_REQUIRED: + case SOUP_STATUS_FORBIDDEN: + return G_IO_ERROR_PERMISSION_DENIED; + + case SOUP_STATUS_NOT_FOUND: + case SOUP_STATUS_GONE: + return G_IO_ERROR_NOT_FOUND; + + case SOUP_STATUS_GATEWAY_TIMEOUT: + return G_IO_ERROR_TIMED_OUT; + } + + return G_IO_ERROR_FAILED; +} + static void g_vfs_job_failed_from_http_status (GVfsJob *job, guint status_code, const char *message) |