fixup: http

This commit is contained in:
Gustavo Sverzut Barbieri 2016-08-22 19:24:13 -03:00
parent f33bab2648
commit fdad382158
1 changed files with 9 additions and 0 deletions

View File

@ -184,6 +184,7 @@ static const Ecore_Getopt options = {
ECORE_GETOPT_STORE_DOUBLE('t', "connect-timeout", "timeout in seconds for the connection phase"),
ECORE_GETOPT_APPEND('H', "header", "Add custom headers. Format must be 'Key: Value'", ECORE_GETOPT_TYPE_STR),
ECORE_GETOPT_STORE_STR('X', "proxy", "Set a specific proxy for the connection"),
ECORE_GETOPT_STORE_STR('c', "cookie-jar", "Set the cookie-jar file to read/save cookies from. Empty means an in-memory cookie-jar"),
ECORE_GETOPT_STORE_STR('i', "input-file", "Input file to use when uploading"),
ECORE_GETOPT_VERSION('V', "version"),
ECORE_GETOPT_COPYRIGHT('C', "copyright"),
@ -211,6 +212,7 @@ main(int argc, char **argv)
char *output_fname = NULL;
char *input_fname = NULL;
char *proxy = NULL;
char *cookie_jar = NULL;
Eina_Bool quit_option = EINA_FALSE;
Eina_Bool authentication_restricted = EINA_FALSE;
Eina_Bool allow_redirects = EINA_TRUE;
@ -228,6 +230,7 @@ main(int argc, char **argv)
ECORE_GETOPT_VALUE_DOUBLE(timeout_dial),
ECORE_GETOPT_VALUE_LIST(headers),
ECORE_GETOPT_VALUE_STR(proxy),
ECORE_GETOPT_VALUE_STR(cookie_jar),
ECORE_GETOPT_VALUE_STR(input_fname),
/* standard block to provide version, copyright, license and help */
@ -309,6 +312,9 @@ main(int argc, char **argv)
http_version = _parse_http_version(http_version_str);
authentication_method = _parse_authentication_method(authentication_method_str);
if (cookie_jar && cookie_jar[0] == ' ')
cookie_jar = "";
dialer = efl_add(EFL_NET_DIALER_HTTP_CLASS, loop,
efl_name_set(efl_self, "dialer"),
efl_net_dialer_http_method_set(efl_self, method),
@ -316,6 +322,7 @@ main(int argc, char **argv)
efl_net_dialer_http_version_set(efl_self, http_version),
efl_net_dialer_http_authentication_set(efl_self, username, password, authentication_method, authentication_restricted),
efl_net_dialer_http_allow_redirects_set(efl_self, allow_redirects),
efl_net_dialer_http_cookie_jar_set(efl_self, cookie_jar),
efl_net_dialer_proxy_set(efl_self, proxy),
efl_net_dialer_timeout_dial_set(efl_self, timeout_dial),
efl_event_callback_array_add(efl_self, dialer_cbs(), NULL));
@ -371,6 +378,7 @@ main(int argc, char **argv)
"INFO: - primary_mode=%d\n"
"INFO: - version=%d\n"
"INFO: - allow_redirects=%d\n"
"INFO: - cookie_jar=%s\n"
"INFO: - timeout_dial=%fs\n"
"INFO: - proxy=%s\n"
"INFO: - request headers:\n",
@ -379,6 +387,7 @@ main(int argc, char **argv)
efl_net_dialer_http_primary_mode_get(dialer),
efl_net_dialer_http_version_get(dialer),
efl_net_dialer_http_allow_redirects_get(dialer),
efl_net_dialer_http_cookie_jar_get(dialer),
efl_net_dialer_timeout_dial_get(dialer),
efl_net_dialer_proxy_get(dialer));