Merge lp:~miguelaraujo/mysql-proxy/pooled-connection-missing-packet-id-reset into lp:mysql-proxy/0.8

Proposed by Miguel Araújo
Status: Merged
Merged at revision: 1247
Proposed branch: lp:~miguelaraujo/mysql-proxy/pooled-connection-missing-packet-id-reset
Merge into: lp:mysql-proxy/0.8
Diff against target: 26 lines (+8/-1)
1 file modified
plugins/proxy/proxy-plugin.c (+8/-1)
To merge this branch: bzr merge lp:~miguelaraujo/mysql-proxy/pooled-connection-missing-packet-id-reset
Reviewer Review Type Date Requested Status
Jan Kneschke (community) Approve
Review via email: mp+95931@code.launchpad.net

Description of the change

added missing packet-id sequence reset when the auth-phase is over:
    - happens when using pooled connections (the server-side connection is already up and authed).

To post a comment you must log in.
Revision history for this message
Jan Kneschke (jan-kneschke) wrote :

Looks good.

A testcase for this is needed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/proxy/proxy-plugin.c'
2--- plugins/proxy/proxy-plugin.c 2012-02-10 13:22:03 +0000
3+++ plugins/proxy/proxy-plugin.c 2012-03-05 16:23:24 +0000
4@@ -867,6 +867,13 @@
5
6 network_mysqld_queue_append(recv_sock, recv_sock->send_queue,
7 S(auth_resp));
8+
9+ /* the server side of connection is already up and authed and we have checked that
10+ * the username and client-scramble are the same as in the previous authed connection.
11+ * the auth phase is over so we need to reset the packet-id sequence
12+ */
13+ network_mysqld_queue_reset(send_sock);
14+ network_mysqld_queue_reset(recv_sock);
15
16 g_string_free(auth_resp, TRUE);
17 }
18@@ -1821,7 +1828,7 @@
19
20 g_assert(con->client->challenge == NULL);
21 con->client->challenge = network_mysqld_auth_challenge_copy(con->server->challenge);
22-
23+
24 con->state = CON_STATE_SEND_HANDSHAKE;
25
26 /**

Subscribers

People subscribed via source and target branches