{
DBG("Continuing ssl handshake: preparing to %s...", want_read ? "read" : "write");
#ifdef PRINT_LOTS_OF_DEBUG
- char buf[32768];
- ssize_t len;
- len = recv(svr->fd, buf, sizeof(buf), MSG_DONTWAIT | MSG_PEEK);
- DBG("%zu bytes in buffer", len);
+ if (want_read)
+ {
+ char buf[32768];
+ ssize_t len;
+ len = recv(svr->fd, buf, sizeof(buf), MSG_DONTWAIT | MSG_PEEK);
+ DBG("%zu bytes in buffer", len);
+ }
#endif
- if (!svr->ssl_state)
+ if (ecore_con_ssl_server_init(svr))
{
- /* we got our server! */
- Ecore_Con_Event_Server_Add *e;
+ ERR("ssl handshaking failed!");
+ Ecore_Con_Event_Server_Del *e;
- svr->connecting = EINA_FALSE;
- e = calloc(1, sizeof(Ecore_Con_Event_Server_Add));
+ e = calloc(1, sizeof(Ecore_Con_Event_Server_Del));
if (e)
{
svr->event_count++;
- svr->start_time = ecore_time_get();
e->server = svr;
- ecore_event_add(ECORE_CON_EVENT_SERVER_ADD, e,
- _ecore_con_event_server_add_free, NULL);
+ ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e,
+ _ecore_con_event_server_del_free, NULL);
}
}
- else if (ecore_con_ssl_server_init(svr))
+ else if (!svr->ssl_state)
{
- ERR("ssl handshaking failed!");
- Ecore_Con_Event_Server_Del *e;
+ /* we got our server! */
+ Ecore_Con_Event_Server_Add *e;
- e = calloc(1, sizeof(Ecore_Con_Event_Server_Del));
+ svr->connecting = EINA_FALSE;
+ e = calloc(1, sizeof(Ecore_Con_Event_Server_Add));
if (e)
{
svr->event_count++;
+ svr->start_time = ecore_time_get();
e->server = svr;
- ecore_event_add(ECORE_CON_EVENT_SERVER_DEL, e,
- _ecore_con_event_server_del_free, NULL);
+ ecore_event_add(ECORE_CON_EVENT_SERVER_ADD, e,
+ _ecore_con_event_server_add_free, NULL);
}
}
+
}
else if (want_read)
if (cl->handshaking && ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ | ECORE_FD_WRITE))
{
- if (!cl->ssl_state)
- {
- Ecore_Con_Event_Client_Add *add;
-
- add = calloc(1, sizeof(Ecore_Con_Event_Client_Add));
- if(add)
- {
-/*cl->event_count++;*/
- add->client = cl;
- _ecore_con_cl_timer_update(cl);
- ecore_event_add(ECORE_CON_EVENT_CLIENT_ADD, add,
- _ecore_con_event_client_add_free, NULL);
- }
- }
- else if (ecore_con_ssl_client_init(cl))
+ if (ecore_con_ssl_client_init(cl))
{
ERR("ssl handshaking failed!");
/* we lost our client! */
}
}
+ else if (!cl->ssl_state)
+ {
+ Ecore_Con_Event_Client_Add *add;
+
+ add = calloc(1, sizeof(Ecore_Con_Event_Client_Add));
+ if(add)
+ {
+/*cl->event_count++;*/
+ add->client = cl;
+ _ecore_con_cl_timer_update(cl);
+ ecore_event_add(ECORE_CON_EVENT_CLIENT_ADD, add,
+ _ecore_con_event_client_add_free, NULL);
+ }
+ }
}
else if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))