Commit 22b3e6f8 authored by unknown's avatar unknown
Browse files

Fixes bug #5588. Additions after merge from 4.0.


sql-common/client.c:
  Fixes bug #5588. checks if operation was timed out.
vio/vio.c:
  Added vio_was_interrupted() function references to detect timed out
  operation properly on win32.
vio/vio_priv.h:
  Added vio_ssl_was_interrupted() function that detects timed out
  operation properly on win32.
vio/viosocket.c:
  Minor changes to follow up the coding standard.
vio/viossl.c:
  Added vio_ssl_was_interrupted() function that detects timed out
  operation properly on win32.
parent c9b589de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ net_safe_read(MYSQL *mysql)
    DBUG_PRINT("error",("Wrong connection or packet. fd: %s  len: %d",
			vio_description(net->vio),len));
#ifdef MYSQL_SERVER
    if (vio_errno(net->vio) == SOCKET_EINTR)
    if (vio_was_interrupted(net->vio))
      return (packet_error);
#endif /*MYSQL_SERVER*/
    end_server(mysql);
+3 −1
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
    vio->fastsend	=vio_fastsend;
    vio->viokeepalive	=vio_keepalive;
    vio->should_retry	=vio_should_retry;
    vio->was_interrupted=vio_was_interrupted;
    vio->vioclose	=vio_close_pipe;
    vio->peer_addr	=vio_peer_addr;
    vio->in_addr	=vio_in_addr;
@@ -69,6 +70,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
    vio->fastsend	=vio_fastsend;
    vio->viokeepalive	=vio_keepalive;
    vio->should_retry	=vio_should_retry;
    vio->was_interrupted=vio_was_interrupted;
    vio->vioclose	=vio_close_shared_memory;
    vio->peer_addr	=vio_peer_addr;
    vio->in_addr	=vio_in_addr;
@@ -88,7 +90,7 @@ void vio_reset(Vio* vio, enum enum_vio_type type,
    vio->fastsend	=vio_ssl_fastsend;
    vio->viokeepalive	=vio_ssl_keepalive;
    vio->should_retry	=vio_ssl_should_retry;
    vio->was_interrupted=vio_was_interrupted;
    vio->was_interrupted=vio_ssl_was_interrupted;
    vio->vioclose	=vio_ssl_close;
    vio->peer_addr	=vio_ssl_peer_addr;
    vio->in_addr	=vio_ssl_in_addr;
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ int vio_ssl_fastsend(Vio *vio);
int vio_ssl_keepalive(Vio *vio, my_bool onoff);
/* Whenever we should retry the last read/write operation. */
my_bool vio_ssl_should_retry(Vio *vio);
/* Check that operation was timed out */
my_bool	vio_ssl_was_interrupted(Vio *vio);
/* When the workday is over... */
int vio_ssl_close(Vio *vio);
/* Return last error number */
+9 −0
Original line number Diff line number Diff line
@@ -184,6 +184,15 @@ vio_ssl_should_retry(Vio * vio __attribute__((unused)))
}


my_bool
vio_ssl_was_interrupted(Vio *vio __attribute__((unused)))
{
  int en= socket_errno;
  return (en == SOCKET_EAGAIN || en == SOCKET_EINTR ||
	  en == SOCKET_EWOULDBLOCK || en == SOCKET_ETIMEDOUT);
}


int vio_ssl_close(Vio * vio)
{
  int r;
+2 −2

File changed.

Contains only whitespace changes.