ecore_con_url: now on top of efl_net_dialer_http.

Rewrite Ecore_Con_Url as a non-Eo (since it's just legacy) that is
built on top of Efl_Net_Dialer_Http.

Since there are some legacy behavior we do not want to expose in the
new classes, hack around and manipulate the curl_easy_setopt()
directly in those cases.

This includes the cookies: there is no reason why we should expose
independent files for read (COOKIEFILE) and write (COOKIEJAR), real
world applications can manipulate the files directly, like copying
from a template to a RDWR before using, etc.
This commit is contained in:
Gustavo Sverzut Barbieri 2016-11-29 03:43:16 -02:00
parent d07e0c3072
commit 2cb3466ddf
6 changed files with 1211 additions and 1384 deletions

View File

@ -33,8 +33,7 @@ ecore_con_eolian_files = \
lib/ecore_con/efl_net_session.eo \
lib/ecore_con/ecore_con_eet_base.eo \
lib/ecore_con/ecore_con_eet_server_obj.eo \
lib/ecore_con/ecore_con_eet_client_obj.eo \
lib/ecore_con/efl_network_url.eo
lib/ecore_con/ecore_con_eet_client_obj.eo
if HAVE_WINDOWS
else
@ -134,8 +133,6 @@ lib/ecore_con/efl_net_control-none.c \
lib/ecore_con/efl_net_session-none.c
endif
EXTRA_DIST2 += lib/ecore_con/ecore_con_legacy.c
# these are included rather than compiled out
# so the structures can be embedded into the
# object Private Data and allows functions to

View File

@ -272,6 +272,22 @@ typedef void (*Ecore_Con_Dns_Cb)(const char *canonname,
#include "Ecore_Con_Eo.h"
#endif
/**
* @struct _Ecore_Con_Url
* Used to provide legacy ABI/ABI compatibility with non-Eo applications.
* @ingroup Ecore_Con_Url_Group
*/
struct _Ecore_Con_Url;
/**
* @typedef Ecore_Con_Url
* Used to provide legacy API/ABI compatibility with non-Eo applications.
* @ingroup Ecore_Con_Url_Group
*/
typedef struct _Ecore_Con_Url Ecore_Con_Url;
/**
* @addtogroup Ecore_Con_Events_Group
* @{
@ -362,16 +378,6 @@ typedef struct _Ecore_Con_Event_Server_Write Ecore_Con_Event_Server_Write;
*/
typedef struct _Ecore_Con_Event_Proxy_Bind Ecore_Con_Event_Proxy_Bind;
#ifdef EFL_BETA_API_SUPPORT
/**
* @typedef Efl_Network_Event_Url_Data
* Used as the @p data param for the corresponding event
* EFL_NETWORK_EVENT_URL_DATA
* @ingroup Ecore_Con_Url_Group
*/
typedef struct _Efl_Network_Event_Url_Data Efl_Network_Event_Url_Data;
#endif
/**
* @typedef Ecore_Con_Event_Url_Data
* Used as the @p data param for the corresponding event
@ -386,16 +392,6 @@ typedef struct _Ecore_Con_Event_Url_Data Ecore_Con_Event_Url_Data;
*/
typedef struct _Ecore_Con_Event_Url_Complete Ecore_Con_Event_Url_Complete;
#ifdef EFL_BETA_API_SUPPORT
/**
* @typedef Efl_Network_Event_Url_Complete
* Used as the @p data param for the corresponding event
* EFL_NETWORK_EVENT_URL_COMPLETE
* @ingroup Ecore_Con_Url_Group
*/
typedef struct _Ecore_Con_Event_Url_Complete Efl_Network_Event_Url_Complete;
#endif
/**
* @typedef Ecore_Con_Event_Url_Progress
* Used as the @p data param for the corresponding event
@ -403,16 +399,6 @@ typedef struct _Ecore_Con_Event_Url_Complete Efl_Network_Event_Url_Complete;
*/
typedef struct _Ecore_Con_Event_Url_Progress Ecore_Con_Event_Url_Progress;
#ifdef EFL_BETA_API_SUPPORT
/**
* @typedef Efl_Network_Event_Url_Progress
* Used as the @p data param for the corresponding event
* EFL_NETWORK_EVENT_URL_PROGRESS
* @ingroup Ecore_Con_Url_Group
*/
typedef struct _Ecore_Con_Event_Url_Progress Efl_Network_Event_Url_Progress;
#endif
/**
* @struct _Ecore_Con_Event_Client_Add
* Used as the @p data param for the @ref ECORE_CON_EVENT_CLIENT_ADD event
@ -544,20 +530,6 @@ struct _Ecore_Con_Event_Proxy_Bind
int port; /**< the proxy-bound port */
};
#ifdef EFL_BETA_API_SUPPORT
/**
* @struct _Efl_Network_Event_Url_Data
* Used as the @p data param for the @ref EFL_NETWORK_EVENT_URL_DATA event
* @ingroup Ecore_Con_Url_Group
*/
struct _Efl_Network_Event_Url_Data
{
Efl_Network_Url *url_con; /**< a pointer to the connection object */
int size; /**< the size of the current received data (in bytes) */
unsigned char *data; /**< pointer to the data received on this event */
};
#endif
/**
* @struct _Ecore_Con_Event_Url_Data
* Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event
@ -1745,6 +1717,26 @@ EAPI Eina_Bool ecore_con_url_pipeline_get(void);
* @see ecore_con_url_url_set()
*/
EAPI Ecore_Con_Url * ecore_con_url_new(const char *url);
/**
* @brief Change the URL assigned to this handle.
*
* @param url_con Connection object to change URL.
* @param url the new URL.
* @return @c EINA_TRUE on success, @c EINA_FALSE on errors.
*/
EAPI Eina_Bool ecore_con_url_url_set(Ecore_Con_Url *url_con,
const char *url);
/**
* @brief Retrieve the URL assigned to this handle.
*
* @param url_con the Connection object to retrieve URL.
* @return @c NULL on error, read-only URL string on success.
*/
EAPI const char *ecore_con_url_url_get(Ecore_Con_Url *url_con);
/**
* @brief Create a custom connection object.
*

View File

@ -2,7 +2,6 @@
#include "efl_network_server.eo.h"
#include "efl_network_connector.eo.h"
#include "efl_network_client.eo.h"
#include "efl_network_url.eo.h"
#include "efl_net_socket.eo.h"
#include "efl_net_dialer.eo.h"

View File

@ -26,25 +26,4 @@ typedef Eo Ecore_Con_Client;
*******************************************************************/
typedef Eo Ecore_Con_Server;
/********************************************************************
* ecore_con_url.eo.h
*******************************************************************/
typedef Eo Ecore_Con_Url;
/********************************************************************
* ecore_con_url.eo.legacy.h
*******************************************************************/
/**
* * Controls the URL to send the request to.
* @param[in] url The URL
*/
EAPI Eina_Bool ecore_con_url_url_set(Ecore_Con_Url *obj, const char *url);
/**
* * Controls the URL to send the request to.
*/
EAPI const char *ecore_con_url_url_get(const Ecore_Con_Url *obj);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
class Efl.Network.Url (Efl.Object) {
[[Uniform Resource Locator (URL) base class]]
eo_prefix: efl_network_url;
methods {
@property url {
[[Controls the URL to send the request to.]]
set {
return: bool (false); [[$true on success, $false on error.]]
}
get {
}
values {
url: string; [[The URL]]
}
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.finalize;
}
events {
data; [[Triggered when data arrives at the socket.]]
progress; [[Triggered when progress is made in upload/download.]]
complete; [[Triggered when the operation is complete.]]
}
}
/* FIXME: Actually migrate all of the functions. */