forked from enlightenment/efl
Simplify the checks in ecore_con_url_http_post_send.
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> SVN revision: 53274
This commit is contained in:
parent
f39cdf2666
commit
8912b4aa1d
|
@ -935,11 +935,6 @@ EAPI Eina_Bool
|
||||||
ecore_con_url_http_post_send(Ecore_Con_Url *url_con, void *httppost)
|
ecore_con_url_http_post_send(Ecore_Con_Url *url_con, void *httppost)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CURL
|
#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))
|
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
|
||||||
{
|
{
|
||||||
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
|
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
|
||||||
|
@ -947,14 +942,11 @@ ecore_con_url_http_post_send(Ecore_Con_Url *url_con, void *httppost)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((url_con->active) || (!url_con->url))
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
url_con->post = httppost;
|
url_con->post = httppost;
|
||||||
|
|
||||||
if (url_con->active)
|
|
||||||
return EINA_FALSE;
|
|
||||||
|
|
||||||
if (!url_con->url)
|
|
||||||
return EINA_FALSE;
|
|
||||||
|
|
||||||
curl_easy_setopt(url_con->curl_easy, CURLOPT_HTTPPOST, httppost);
|
curl_easy_setopt(url_con->curl_easy, CURLOPT_HTTPPOST, httppost);
|
||||||
|
|
||||||
return ecore_con_url_send(url_con, NULL, 0, NULL);
|
return ecore_con_url_send(url_con, NULL, 0, NULL);
|
||||||
|
|
Loading…
Reference in New Issue