Ejemplo n.º 1
0
static my_bool ssl_should_retry(Vio *vio, int ret, enum enum_vio_io_event *event)
{
  int ssl_error;
  SSL *ssl= vio->ssl_arg;
  my_bool should_retry= TRUE;

  /* Retrieve the result for the SSL I/O operation. */
  ssl_error= SSL_get_error(ssl, ret);

  /* Retrieve the result for the SSL I/O operation. */
  switch (ssl_error)
  {
  case SSL_ERROR_WANT_READ:
    *event= VIO_IO_EVENT_READ;
    break;
  case SSL_ERROR_WANT_WRITE:
    *event= VIO_IO_EVENT_WRITE;
    break;
  default:
#ifndef DBUG_OFF
    report_errors(ssl);
#endif
    should_retry= FALSE;
    ssl_set_sys_error(ssl_error);
    break;
  }

  return should_retry;
}
Ejemplo n.º 2
0
static my_bool ssl_should_retry(Vio *vio, int ret,
                                enum enum_vio_io_event *event,
                                unsigned long *ssl_errno_holder)
{
  int ssl_error;
  SSL *ssl= vio->ssl_arg;
  my_bool should_retry= TRUE;

  /* Retrieve the result for the SSL I/O operation. */
  ssl_error= SSL_get_error(ssl, ret);

  /* Retrieve the result for the SSL I/O operation. */
  switch (ssl_error)
  {
  case SSL_ERROR_WANT_READ:
    *event= VIO_IO_EVENT_READ;
    break;
  case SSL_ERROR_WANT_WRITE:
    *event= VIO_IO_EVENT_WRITE;
    break;
  default:
#ifndef DBUG_OFF  /* Debug build */
    /* Note: the OpenSSL error queue gets cleared in report_errors(). */
    report_errors(ssl);
#else             /* Release build */
# ifndef HAVE_YASSL
    /* OpenSSL: clear the error queue. */
    ERR_clear_error();
# endif
#endif
    should_retry= FALSE;
    ssl_set_sys_error(ssl_error);
    break;
  }

  *ssl_errno_holder= ssl_error;

  return should_retry;
}