Permalink
Browse files

Implemented a workaround with leastSize - should work now as the orig…

…inal.
  • Loading branch information...
s-ludwig committed May 1, 2012
1 parent 0fae2ed commit 780dbea4f86de0b9977933c0b98f6c203b1b94b5
Showing with 7 additions and 2 deletions.
  1. +7 −2 source/mysql.d
View
@@ -1279,8 +1279,9 @@ protected:
void parseGreeting()
{
+ // TODO: make the following code work instead of the leastSize workaround below:
// read the handshake message from the socket
- _packet.length = 255;
+ /*_packet.length = 255;
ubyte[] dst = _packet;
_socket.read(dst[0 .. 1]);
dst.popFront();
@@ -1304,7 +1305,11 @@ protected:
enforce(dst[scramble_length] == 0, "Handshake packet must be zero terminated.");
dst.popFrontN(scramble_length+1);
- _packet.length = _packet.length - dst.length;
+ _packet.length = _packet.length - dst.length;*/
+
+ // for now we leave the original behavior to use the network to determine the packet size
+ _packet.length = cast(size_t)_socket.leastSize;
+ _socket.read(_packet);
_cpn++;

0 comments on commit 780dbea

Please sign in to comment.