2012-03-07 ChunEon Park (Hermet)
* Add ecore_x_illume_clipboard_state_set()
- ecore_x_illume_clipboard_state_get()
- ecore_x_illume_clipboard_geometry_set()
- ecore_x_illume_clipboard_geometry_get()
+ ecore_x_illume_clipboard_state_get()
+ ecore_x_illume_clipboard_geometry_set()
+ ecore_x_illume_clipboard_geometry_get()
-2012-03-07 Carsten Haitzler (The Rasterman)
+2012-03-07 Carsten Haitzler (The Rasterman)
* Add atoms and api for rotation and indicator transparency in
ecore_x/ecore_evas
+
+2012-03-07 Mike Blumenkrantz (discomfitor/zmike)
+
+ * Add ecore_con_url_status_code_get() to check return code at any time
- ECORE_CON_REMOTE_CORK
- ecore_con_url_proxy_set()
- ecore_con_url_timeout_set()
- - ecore_con_url_proxy_username_set
+ - ecore_con_url_proxy_username_set()
- ecore_con_url_proxy_password_set()
- ecore_con_url_http_version_set()
+ - ecore_con_url_status_code_get()
* ecore_x:
- ecore_x_randr_output_backlight_available()
- ecore_x_randr_window_crtcs_get()
EAPI void ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout);
/**
+ * Get the returned HTTP STATUS code
+ *
+ * This is used to, at any time, try to return the status code for a transmission.
+ * @param url_con Connection object
+ * @return A valid HTTP STATUS code, or -1 on failure
+ *
+ * @since 1.2
+ */
+EAPI int ecore_con_url_status_code_get(Ecore_Con_Url *url_con);
+/**
* @}
*/
static Eina_Bool _ecore_con_url_timer(void *data);
static Eina_Bool _ecore_con_url_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_con_url_timeout_cb(void *data);
+static void _ecore_con_url_status_get(Ecore_Con_Url *url_con);
static Eina_List *_url_con_list = NULL;
static Eina_List *_fd_hd_list = NULL;
#endif
}
+EAPI int
+ecore_con_url_status_code_get(Ecore_Con_Url *url_con)
+{
+#ifdef HAVE_CURL
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, __func__);
+ return -1;
+ }
+
+ _ecore_con_url_status_get(url_con);
+ return url_con->status ?: -1;
+#else
+ return -1;
+ (void)url_con;
+#endif
+}
+
EAPI Eina_Bool
ecore_con_url_url_set(Ecore_Con_Url *url_con, const char *url)
{
EINA_LIST_FREE(url_con->response_headers, s)
free((char *)s);
url_con->response_headers = NULL;
+ url_con->status = 0;
curl_slist_free_all(url_con->headers);
url_con->headers = NULL;
_ecore_con_url_status_get(Ecore_Con_Url *url_con)
{
long status = 0;
+
+ if (!url_con->curl_easy) return;
if (curl_easy_getinfo(url_con->curl_easy, CURLINFO_RESPONSE_CODE, &status))
url_con->status = status;
+ else
+ url_con->status = 0;
}
static void