MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Konstantin Osipov Date:November 20 2009 11:12pm
Subject:bzr commit into mysql-5.6-next-mr branch (kostja:2932)
View as plain text  
#At file:///opt/local/work/next-mr-kostja/ based on revid:kostja@stripped

 2932 Konstantin Osipov	2009-11-21
      Backport the implementation of vio_pending from 6.0-codebase.
      Original changeset:
      ------------------------------------------------------------
      revno: 2626
      committer: davi@stripped/endora.local
      timestamp: Wed 2008-04-23 09:33:25 -0300
      message:
      Fix for main.ssl and main.ssl_compress test case failures under pool-of-threads.
      
      The problem is that the SSL layer has a read buffer and might read
      more data than requested by the VIO layer. The SSL layer empties the
      socket buffer which causes the socket to not be signaled for IO if
      the client is waiting for a command which is sitting in the read
      buffer.
      
      The solution is to retrieve from the transport layer the number of
      bytes waiting in the read buffer. The data in the read buffer needs
      to be processed before waiting for more data.

    modified:
      include/violite.h
      vio/viosocket.c
=== modified file 'include/violite.h'
--- a/include/violite.h	2009-11-19 23:48:08 +0000
+++ b/include/violite.h	2009-11-20 23:12:23 +0000
@@ -86,6 +86,7 @@ my_bool	vio_peer_addr(Vio* vio, char *bu
 void	vio_in_addr(Vio *vio, struct in_addr *in);
 my_bool vio_poll_read(Vio *vio, uint timeout);
 my_bool vio_is_connected(Vio *vio);
+ssize_t vio_pending(Vio *vio);
 
 #ifdef HAVE_OPENSSL
 #include <openssl/opensslv.h>

=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c	2009-11-19 23:48:08 +0000
+++ b/vio/viosocket.c	2009-11-20 23:12:23 +0000
@@ -855,3 +855,27 @@ int vio_close_shared_memory(Vio * vio)
 }
 #endif /* HAVE_SMEM */
 #endif /* __WIN__ */
+
+
+/**
+  Number of bytes in the read buffer.
+
+  @return number of bytes in the read buffer or < 0 if error.
+*/
+
+ssize_t vio_pending(Vio *vio)
+{
+#ifdef HAVE_OPENSSL
+  SSL *ssl= (SSL*) vio->ssl_arg;
+#endif
+
+  if (vio->read_pos < vio->read_end)
+    return vio->read_end - vio->read_pos;
+
+#ifdef HAVE_OPENSSL
+  if (ssl)
+    return SSL_pending(ssl);
+#endif
+
+  return 0;
+}


Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20091120231223-53r91trufbp4801z.bundle
Thread
bzr commit into mysql-5.6-next-mr branch (kostja:2932)Konstantin Osipov21 Nov