diff options
author | Not Zed <NotZed@Ximian.com> | 2003-04-23 09:34:03 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-04-23 09:34:03 +0800 |
commit | 41e808deca2ad8654b6f8528ae3492013951fcbd (patch) | |
tree | 352295bf10079041170d50b585f5bb44ecf0ad61 /camel/camel-url.c | |
parent | 36875999d7315e9f36eb9d9b8f657a0bd38a0751 (diff) | |
download | gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar.gz gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.tar.zst gsoc2013-evolution-41e808deca2ad8654b6f8528ae3492013951fcbd.zip |
** Should fix #41629, #41448, et al.
2003-04-22 Not Zed <NotZed@Ximian.com>
** Should fix #41629, #41448, et al.
* tests/folder/test10.c: a new torture test for object bag
creation/unreffing.
* camel-url.c (camel_url_copy): new function to copy a url.
* camel-object.c (camel_object_bag_new): add arguments for key
copy and key free functions. Fixed all callers.
(camel_object_bag_destroy): fix a memleak, free the bag key.
(camel_object_bag_get, camel_object_bag_reserve)
(camel_object_bag_abort, save_bag, save_object): Make the key a
void type, rather than char *.
(camel_object_bag_add): As above, and also copy the key.
(camel_object_bag_remove_unlocked): free the key using
bag->free_key.
* camel-session.c (register_provider)
(camel_session_destroy_provider, get_service): Changed to use an
object bag instead of a hash table for the service 'cache'.
(service_cache_remove): Removed, no longer required.
svn path=/trunk/; revision=20930
Diffstat (limited to 'camel/camel-url.c')
-rw-r--r-- | camel/camel-url.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/camel/camel-url.c b/camel/camel-url.c index 7b1c31db5c..78a5beec44 100644 --- a/camel/camel-url.c +++ b/camel/camel-url.c @@ -560,3 +560,25 @@ camel_url_equal(const void *v, const void *v2) && check_equal(u1->query, u2->query) && u1->port == u2->port; } + +CamelURL * +camel_url_copy(const CamelURL *in) +{ + CamelURL *out; + + out = g_malloc(sizeof(*out)); + out->protocol = g_strdup(in->protocol); + out->user = g_strdup(in->user); + out->authmech = g_strdup(in->authmech); + out->passwd = g_strdup(in->passwd); + out->host = g_strdup(in->host); + out->port = in->port; + out->path = g_strdup(in->path); + out->params = NULL; + if (in->params) + g_datalist_foreach(&((CamelURL *)in)->params, copy_param, &out->params); + out->query = g_strdup(in->query); + out->fragment = g_strdup(in->fragment); + + return out; +} |