fprintf(9 removed

This commit is contained in:
Massimiliano Pinto 2013-12-17 11:07:29 +01:00
parent b2f6d5494e
commit 05d365e4b4
5 changed files with 3 additions and 32 deletions

View File

@ -136,7 +136,6 @@ int gw_read_gwbuff(DCB *dcb, GWBUF **head, int b) {
int n = -1;
if (b <= 0) {
//fprintf(stderr, "||| read_gwbuff called with 0 bytes for %i, closing\n", dcb->fd);
ss_dassert(false);
#if 0
dcb->func.close(dcb);
@ -157,11 +156,9 @@ int gw_read_gwbuff(DCB *dcb, GWBUF **head, int b) {
if (n < 0) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
/* fprintf(stderr, "Client connection %i: continue for %i, %s\n", dcb->fd, errno, strerror(errno)); */
gwbuf_free(buffer);
return 1;
} else {
/* fprintf(stderr, "Client connection %i error: %i, %s\n", dcb->fd, errno, strerror(errno)); */
gwbuf_free(buffer);
(dcb->func).close(dcb);
return 1;
@ -170,7 +167,6 @@ int gw_read_gwbuff(DCB *dcb, GWBUF **head, int b) {
if (n == 0) {
// socket closed
/* fprintf(stderr, "Client connection %i closed: %i, %s\n", dcb->fd, errno, strerror(errno)); */
gwbuf_free(buffer);
#if 1
(dcb->func).close(dcb);

View File

@ -204,7 +204,6 @@ HTTPD_session *client_data = NULL;
if (strncasecmp(buf, "useragent", 9) == 0) {
strcpy(client_data->useragent, value);
}
//fprintf(stderr, "<<< Header [%s:%s]\n", buf, value);
}
}

View File

@ -862,7 +862,6 @@ static int gw_change_user(DCB *backend, SERVER *server, SESSION *in_session, GWB
if (auth_ret != 0) {
/*< vraa : errorHandle */
fprintf(stderr, "<<< CLIENT AUTH FAILED for user [%s], user session will not change!\n", username);
// send the error packet
mysql_send_auth_error(backend->session->client, 1, 0, "Authorization failed on change_user");

View File

@ -28,7 +28,9 @@
* 17/06/2013 Massimiliano Pinto Added Client To Gateway routines
* 24/06/2013 Massimiliano Pinto Added: fetch passwords from service users' hashtable
* 02/09/2013 Massimiliano Pinto Added: session refcount
* 16/12/2013 Massimiliano Pinto Added: client closed socket detection with recv(..., MSG_PEEK)
*/
#include <skygw_utils.h>
#include <log_manager.h>
#include <mysql_client_server_protocol.h>
@ -382,7 +384,6 @@ static int gw_mysql_do_authentication(DCB *dcb, GWBUF *queue) {
*/
// now get the user
strcpy(username, (char *)(client_auth_packet + 4 + 4 + 4 + 1 + 23));
/* fprintf(stderr, "<<< Client username is [%s]\n", username); */
// get the auth token len
memcpy(&auth_token_len,
@ -394,7 +395,6 @@ static int gw_mysql_do_authentication(DCB *dcb, GWBUF *queue) {
strcpy(database,
(char *)(client_auth_packet + 4 + 4 + 4 + 1 + 23 + strlen(username) +
1 + 1 + auth_token_len));
/* fprintf(stderr, "<<< Client selected db is [%s]\n", database); */
} else {
/* fprintf(stderr, "<<< Client is NOT connected with db\n"); */
}
@ -730,7 +730,6 @@ int gw_write_client_event(DCB *dcb)
ss_dassert(dcb->state != DCB_STATE_DISCONNECTED);
if (dcb == NULL) {
fprintf(stderr, "DCB is NULL, return\n");
goto return_1;
}

View File

@ -106,29 +106,17 @@ void gw_mysql_close(MySQLProtocol **ptr) {
if (*ptr == NULL)
return;
#ifdef MYSQL_CONN_DEBUG
fprintf(stderr, "Closing MySQL connection %i, [%s]\n", conn->fd, conn->scramble);
#endif
if (conn->fd > 0) {
/* COM_QUIT will not be sent here, but from the caller of this routine! */
#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
// no socket here
}
free(*ptr);
*ptr = NULL;
#ifdef MYSQL_CONN_DEBUG
fprintf(stderr, "mysqlgw_mysql_close() free(conn) done\n");
#endif
}
/**
@ -429,10 +417,6 @@ int gw_send_authentication_to_backend(
dcb = conn->owner_dcb;
#ifdef DEBUG_MYSQL_CONN
fprintf(stderr, ">> Sending credentials %s, %s, db %s\n", user, passwd, dbname);
#endif
// Zero the vars
memset(&server_capabilities, '\0', sizeof(server_capabilities));
memset(&final_capabilities, '\0', sizeof(final_capabilities));
@ -844,10 +828,6 @@ int gw_send_change_user_to_backend(char *dbname, char *user, uint8_t *passwd, My
dcb = conn->owner_dcb;
#ifdef DEBUG_MYSQL_CONN
fprintf(stderr, ">> Sending credentials %s, %s, db %s\n", user, passwd, dbname);
#endif
// Zero the vars
memset(&server_capabilities, '\0', sizeof(server_capabilities));
memset(&final_capabilities, '\0', sizeof(final_capabilities));
@ -1029,7 +1009,6 @@ int gw_check_mysql_scramble_data(DCB *dcb, uint8_t *token, unsigned int token_le
ret_val = gw_find_mysql_user_password_sha1(username, password, (DCB *) dcb);
if (ret_val) {
fprintf(stderr, "<<<< User [%s] was not found\n", username);
return 1;
}
@ -1044,7 +1023,6 @@ int gw_check_mysql_scramble_data(DCB *dcb, uint8_t *token, unsigned int token_le
/* check if the password is not set in the user table */
if (!strlen((char *)password)) {
/* Username without password */
//fprintf(stderr, ">>> continue WITHOUT auth, no password\n");
return 0;
} else {
return 1;