diff options
author | Haru <haru@dotalux.com> | 2015-06-18 01:52:38 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-08-15 00:51:38 +0200 |
commit | 1034bfb7a390cb21623c3892f4d2304e2458af79 (patch) | |
tree | 236ce246af0d248cff51bb85725a735c5aeccb06 /src/login/loginlog_sql.c | |
parent | 747d3b7d5c6056470b1c9d3f41e09e0ed92af6d6 (diff) | |
download | hercules-1034bfb7a390cb21623c3892f4d2304e2458af79.tar.gz hercules-1034bfb7a390cb21623c3892f4d2304e2458af79.tar.bz2 hercules-1034bfb7a390cb21623c3892f4d2304e2458af79.tar.xz hercules-1034bfb7a390cb21623c3892f4d2304e2458af79.zip |
Cleaned up socket interface
- Replaced some macro calls with the proper interface syntax
- Removed useless macros and workarounds
API changes summary:
- WFIFOSET() can now be safely used both inside and outside socket.c
- RFIFOSKIP() can now be safely used both inside and outside socket.c
- do_close() is now sockt->close()
- flush_fifo() is now sockt->flush()
- flush_fifos() is now sockt->flush_fifos()
- getips() is now sockt->getips()
- host2ip() is now sockt->host2ip()
- ip2str() is now sockt->ip2str()
- ntows() is now sockt->ntows()
- make_connection() is now sockt->make_connection()
- make_listen_bind() is now sockt->make_listen_bind()
- realloc_fifo() is now sockt->realloc_fifo()
- realloc_writefifo() is now sockt->realloc_writefifo()
- session_isActive() is now sockt->session_is_active()
- session_isValid() is now sockt->session_is_valid()
- set_defaultparse() is now sockt->set_defaultparse()
- set_eof() is now sockt->eof()
- set_noblocking() is now sockt->set_noblocking()
- str2ip() is now sockt->str2ip()
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/login/loginlog_sql.c')
-rw-r--r-- | src/login/loginlog_sql.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index da698e187..d26d910de 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -44,7 +44,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes) return 0; if( SQL_ERROR == SQL->Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %d MINUTE", - log_login_db, ip2str(ip,NULL), minutes) )// how many times failed account? in one ip. + log_login_db, sockt->ip2str(ip,NULL), minutes) )// how many times failed account? in one ip. Sql_ShowDebug(sql_handle); if( SQL_SUCCESS == SQL->NextRow(sql_handle) ) @@ -78,7 +78,7 @@ void login_log(uint32 ip, const char* username, int rcode, const char* message) retcode = SQL->Query(sql_handle, "INSERT INTO `%s`(`time`,`ip`,`user`,`rcode`,`log`) VALUES (NOW(), '%s', '%s', '%d', '%s')", - log_login_db, ip2str(ip,NULL), esc_username, rcode, esc_message); + log_login_db, sockt->ip2str(ip,NULL), esc_username, rcode, esc_message); if( retcode != SQL_SUCCESS ) Sql_ShowDebug(sql_handle); |