Removed old gateway_mysql_protocol.c
server/core/Makefile updtated
This commit is contained in:
parent
b01cf2365e
commit
6888735f7b
@ -53,7 +53,7 @@ LDFLAGS=-rdynamic -L$(LOGPATH) \
|
||||
-Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) \
|
||||
-Wl,-rpath,$(MARIADB_SRC_PATH)/libmysqld
|
||||
|
||||
SRCS= atomic.c buffer.c spinlock.c gateway.c gateway_mysql_protocol.c \
|
||||
SRCS= atomic.c buffer.c spinlock.c gateway.c \
|
||||
gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c \
|
||||
poll.c config.c users.c hashtable.c dbusers.c thread.c gwbitmask.c \
|
||||
monitor.c adminusers.c secrets.c
|
||||
|
@ -1,115 +0,0 @@
|
||||
/*
|
||||
* This file is distributed as part of the SkySQL Gateway. It is free
|
||||
* software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation,
|
||||
* version 2.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright SkySQL Ab 2013
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 23-05-2013 Massimiliano Pinto Empty mysql_protocol_handling
|
||||
* 1)send handshake in accept
|
||||
* 2) read data
|
||||
* 3) alway send OK
|
||||
* 12-06-2013 Mark Riddoch Move mysql_send_ok and MySQLSendHandshake
|
||||
* to use the new buffer management scheme
|
||||
* 13-06-2013 Massimiliano Pinto Added mysql_authentication check
|
||||
* 14-06-2013 Massimiliano Pinto gw_mysql_do_authentication puts user, db, and client_sha1 in the
|
||||
(MYSQL_session *) session->data of client DCB.
|
||||
gw_mysql_connect can now access this session->data for
|
||||
transparent authentication
|
||||
*/
|
||||
|
||||
|
||||
#include <gw.h>
|
||||
#include <dcb.h>
|
||||
#include <session.h>
|
||||
#include <buffer.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include <skygw_types.h>
|
||||
#include <skygw_utils.h>
|
||||
#include <log_manager.h>
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// MYSQL_conn structure setup
|
||||
///////////////////////////////////////
|
||||
MySQLProtocol *gw_mysql_init(MySQLProtocol *data) {
|
||||
|
||||
MySQLProtocol *input = NULL;
|
||||
|
||||
// structure allocation
|
||||
input = calloc(1, sizeof(MySQLProtocol));
|
||||
|
||||
if (input == NULL) {
|
||||
int eno = errno;
|
||||
errno = 0;
|
||||
skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
"%lu [gw_mysql_init] failed to allocate memory for MySQL "
|
||||
"protocol object. Errno %d, %s.",
|
||||
pthread_self(),
|
||||
eno,
|
||||
strerror(eno));
|
||||
goto return_input;
|
||||
}
|
||||
input->protocol_chk_top = CHK_NUM_PROTOCOL;
|
||||
input->protocol_chk_tail = CHK_NUM_PROTOCOL;
|
||||
#ifdef MYSQL_CONN_DEBUG
|
||||
fprintf(stderr, "gw_mysql_init() called\n");
|
||||
#endif
|
||||
return_input:
|
||||
return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////
|
||||
// close a connection if opened
|
||||
// free data scructure
|
||||
//////////////////////////////////////
|
||||
void gw_mysql_close(MySQLProtocol **ptr) {
|
||||
MySQLProtocol *conn = *ptr;
|
||||
|
||||
if (*ptr == NULL)
|
||||
return;
|
||||
|
||||
fprintf(stderr, "Closing MySQL connection %i, [%s]\n", conn->fd, conn->scramble);
|
||||
|
||||
if (conn->fd > 0) {
|
||||
//write COM_QUIT
|
||||
//write
|
||||
|
||||
#ifdef MYSQL_CONN_DEBUG
|
||||
fprintf(stderr, "mysqlgw_mysql_close() called for %i\n", conn->fd);
|
||||
#endif
|
||||
close(conn->fd);
|
||||
} else {
|
||||
#ifdef MYSQL_CONN_DEBUG
|
||||
fprintf(stderr, "mysqlgw_mysql_close() called, no socket %i\n", conn->fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
free(*ptr);
|
||||
|
||||
*ptr = NULL;
|
||||
|
||||
#ifdef MYSQL_CONN_DEBUG
|
||||
fprintf(stderr, "mysqlgw_mysql_close() free(conn)\n");
|
||||
#endif
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user