By checking for the validity of the Ecore_Con_Url struct before anything
else and merging some if's, the code can get much cleaner.
By: Raphael Kubo da Costa <kubo@profusion.mobi>
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@53274
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
ecore_con_url_http_post_send(Ecore_Con_Url *url_con, void *httppost)
{
#ifdef HAVE_CURL
- if (url_con->post)
- curl_formfree(url_con->post);
-
- url_con->post = NULL;
-
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
return EINA_FALSE;
}
- url_con->post = httppost;
-
- if (url_con->active)
+ if ((url_con->active) || (!url_con->url))
return EINA_FALSE;
- if (!url_con->url)
- return EINA_FALSE;
+ url_con->post = httppost;
curl_easy_setopt(url_con->curl_easy, CURLOPT_HTTPPOST, httppost);