Commit 489a9d5c authored by unknown's avatar unknown
Browse files

Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint


sql/net_serv.cc:
  Auto merged
vio/viosocket.c:
  Auto merged
parents cbc556eb 32741794
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -859,7 +859,7 @@ my_real_read(NET *net, ulong *complen)
#endif /* EXTRA_DEBUG */
	  }
#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER)
	  if (vio_should_retry(net->vio))
	  if (vio_errno(net->vio) == SOCKET_EINTR)
	  {
	    DBUG_PRINT("warning",("Interrupted read. Retrying..."));
	    continue;
+22 −8
Original line number Diff line number Diff line
@@ -378,16 +378,30 @@ my_bool vio_poll_read(Vio *vio,uint timeout)
}


void vio_timeout(Vio *vio __attribute__((unused)),
		 uint which __attribute__((unused)),
                 uint timeout __attribute__((unused)))
void vio_timeout(Vio *vio, uint which, uint timeout)
{
/* TODO: some action should be taken if socket timeouts are not supported. */
#if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)

#ifdef __WIN__
  ulong wait_timeout= (ulong) timeout * 1000;
  (void) setsockopt(vio->sd, SOL_SOCKET, 
	which ? SO_SNDTIMEO : SO_RCVTIMEO, (char*) &wait_timeout,
        sizeof(wait_timeout));
#endif /* __WIN__ */

  /* Windows expects time in milliseconds as int. */
  int wait_timeout= (int) timeout * 1000;

#else  /* ! __WIN__ */

  /* POSIX specifies time as struct timeval. */
  struct timeval wait_timeout;
  wait_timeout.tv_sec= timeout;
  wait_timeout.tv_usec= 0;

#endif /* ! __WIN__ */

  /* TODO: return value should be checked. */
  (void) setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO,
                    (char*) &wait_timeout, sizeof(wait_timeout));

#endif /* defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO) */
}