← Back to team overview

mysql-proxy-discuss team mailing list archive

Some questions about the proxy plugin

 

Hi all.

I am studying and writing some new features to the proxy plugin. But now I'm stuck in progress with some doubts.
I will try to simplify the questions and hope than you can help me.

So, by steps:

1) I did not changed nothing in the proxy plugin code. I've added a new event handler to an extern application running on background. 

2) When an event happens, a callback is done. This callback function obtains an SQL query and calls a function whose propose is to create an MySQL packet with that query and send it like it was an MySQL client.

3) The proxy plugin will receive it normally, and call the read_query Lua function that will pass the query to the backend with the 'proxy.PROXY_SEND_QUERY'.

This function (send_mysql_query) is defined like this:  http://pastebin.com/aDHw43q0


The question is, do I need to create a new connection like the network_mysqld_con_accept does?
Or can I use an existing one, and before I write to the socket I change the connection state to CON_STATE_READ_QUERY, like I do on the send_mysql_query?
I am passing the connection created on the networkd_mysqld_proxy_plugin_apply_config to the function. But this it not working...


Thank you,
Miguel Araújo

--
Miguel Araújo
| miguelaraujo@xxxxxxxxxxxxxxxx |