From 48bb4c6252c46b55bb8bf27c159ce42d37b33271 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sat, 23 Jul 2011 03:17:57 +0000 Subject: [PATCH] url of ecore-con-url is now stringshared SVN revision: 61607 --- legacy/ecore/src/lib/ecore_con/Ecore_Con.h | 2 +- legacy/ecore/src/lib/ecore_con/ecore_con_private.h | 2 +- legacy/ecore/src/lib/ecore_con/ecore_con_url.c | 9 ++------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h index 0cd4c3e2d0..0bf39980a3 100644 --- a/legacy/ecore/src/lib/ecore_con/Ecore_Con.h +++ b/legacy/ecore/src/lib/ecore_con/Ecore_Con.h @@ -1198,7 +1198,7 @@ EAPI Eina_Bool ecore_con_url_url_set(Ecore_Con_Url *url_con, * Gets the URL to send the request to. * * @param url_con Connection object through which the request will be sent. - * @return URL that will receive the request, NULL on failure + * @return URL that will receive the request, NULL on failure. URL is stringshared. * @since 1.1 */ EAPI const char *ecore_con_url_url_get(Ecore_Con_Url *url_con); diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_private.h b/legacy/ecore/src/lib/ecore_con/ecore_con_private.h index 67a4b89cd3..908f279171 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con_private.h +++ b/legacy/ecore/src/lib/ecore_con/ecore_con_private.h @@ -181,7 +181,7 @@ struct _Ecore_Con_Url struct curl_slist *headers; Eina_List *additional_headers; Eina_List *response_headers; - char *url; + const char *url; Ecore_Con_Url_Time time_condition; double timestamp; diff --git a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c index 6575fc19d1..a6fbb82a3b 100644 --- a/legacy/ecore/src/lib/ecore_con/ecore_con_url.c +++ b/legacy/ecore/src/lib/ecore_con/ecore_con_url.c @@ -372,7 +372,7 @@ ecore_con_url_free(Ecore_Con_Url *url_con) free(s); EINA_LIST_FREE(url_con->response_headers, s) free(s); - free(url_con->url); + eina_stringshare_del(url_con->url); free(url_con); #else return; @@ -410,12 +410,7 @@ ecore_con_url_url_set(Ecore_Con_Url *url_con, if (url_con->active) return EINA_FALSE; - if (url_con->url) - free(url_con->url); - - url_con->url = NULL; - if (url) - url_con->url = strdup(url); + eina_stringshare_replace(&url_con->url, url); if (url_con->url) curl_easy_setopt(url_con->curl_easy, CURLOPT_URL,