xmlNodePtr cur = NULL;
char *extraheaders = g_strdup_printf("Depth: %d\r\n", depth);
gboolean found_root_node_props;
+ gboolean handle_valid = FALSE;
GByteArray *request = g_byte_array_new();
char *request_str = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
result = make_request (handle, uri, "PROPFIND", request,
extraheaders, context);
+ if (result == GNOME_VFS_OK)
+ handle_valid = TRUE;
/* FIXME bugzilla.gnome.org 43834: It looks like some http
* servers (eg, www.yahoo.com) treat PROPFIND as a GET and
g_free(extraheaders);
xmlFreeParserCtxt(parserContext);
- if (result != GNOME_VFS_OK) {
+ if (result != GNOME_VFS_OK && handle_valid) {
http_handle_close (handle, context);
- g_free (handle);
}
ANALYZE_HTTP ("==> -make_propfind_request");
g_free (handle);
handle = NULL;
} else {
+ g_free (handle);
+ handle = NULL;
g_assert (handle == NULL); /* Make sure we're not leaking some old one */
/* Lame buggy servers (eg: www.mozilla.org,
gnome_vfs_file_info_copy (file_info, handle->file_info);
http_cache_add_uri (uri, handle->file_info, FALSE);
http_handle_close (handle, context);
- g_free (handle);
}
+ g_free (handle);
+ handle = NULL;
/* If we get a redirect, we should be
* basing the MIME type on the type of