if (svr->handshaking && ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ | ECORE_FD_WRITE))
{
DBG("Continuing ssl handshake");
+ if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))
+ DBG("Preparing to read handshake data...");
+ else
+ DBG("Preparing to write handshake data...");
+#ifdef PRINT_LOTS_OF_DEBUG
+ if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_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)
{
/* we got our server! */
gnutls_transport_set_ptr(svr->session, (gnutls_transport_ptr_t)svr->fd);
svr->ssl_state = ECORE_CON_SSL_STATE_HANDSHAKING;
case ECORE_CON_SSL_STATE_HANDSHAKING:
- DBG("gnutls handshaking");
+ DBG("calling gnutls_handshake()");
ret = gnutls_handshake(svr->session);
SSL_ERROR_CHECK_GOTO_ERROR(gnutls_error_is_fatal(ret));
if (!ret)
gnutls_transport_set_ptr(cl->session, (gnutls_transport_ptr_t)cl->fd);
cl->ssl_state = ECORE_CON_SSL_STATE_HANDSHAKING;
case ECORE_CON_SSL_STATE_HANDSHAKING:
- DBG("gnutls handshaking");
+ DBG("calling gnutls_handshake()");
ret = gnutls_handshake(cl->session);
SSL_ERROR_CHECK_GOTO_ERROR(gnutls_error_is_fatal(ret));