vio->write_packet() callback method for server authentication plugins This function is called by a server authentication plugin, when it wants to send data to the client. It transparently wraps the data into a handshake packet, and handles plugin negotiation with the client. If necessary, it escapes the plugin data, if it starts with a mysql protocol packet byte. */
| 14694 | it escapes the plugin data, if it starts with a mysql protocol packet byte. |
| 14695 | */ |
| 14696 | static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param, |
| 14697 | const uchar *packet, int packet_len) |
| 14698 | { |
| 14699 | MPVIO_EXT *mpvio= (MPVIO_EXT *) param; |
| 14700 | int res; |
| 14701 | DBUG_ENTER("server_mpvio_write_packet"); |
| 14702 | |
| 14703 | /* reset cached_client_reply */ |
| 14704 | mpvio->cached_client_reply.pkt= 0; |
| 14705 | |
| 14706 | /* for the 1st packet we wrap plugin data into the handshake packet */ |
| 14707 | if (mpvio->packets_written == 0) |
| 14708 | res= send_server_handshake_packet(mpvio, (char*) packet, packet_len); |
| 14709 | else if (mpvio->status == MPVIO_EXT::RESTART) |
| 14710 | res= send_plugin_request_packet(mpvio, packet, packet_len); |
| 14711 | else /* plugin data, prefixed with 1 */ |
| 14712 | res= net_write_command(&mpvio->auth_info.thd->net, 1, (uchar*)"", 0, |
| 14713 | packet, packet_len); |
| 14714 | mpvio->cached_client_reply.plugin= ""_LEX_CSTRING; |
| 14715 | mpvio->status= MPVIO_EXT::FAILURE; // the status is no longer RESTART |
| 14716 | mpvio->packets_written++; |
| 14717 | DBUG_RETURN(res); |
| 14718 | } |
| 14719 | |
| 14720 | /** |
| 14721 | vio->read_packet() callback method for server authentication plugins |
no test coverage detected