summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-16 21:14:33 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-16 21:14:33 +0000
commit5cd75ecd95c257e61c15fef5692918c5642e2aea (patch)
tree76433fa0e32f228d737b651a81ded6da34fbf1aa /src/common
parent77912311a7ad7151e4a2476cac73f3ec181d27bd (diff)
downloadhercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.tar.gz
hercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.tar.bz2
hercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.tar.xz
hercules-5cd75ecd95c257e61c15fef5692918c5642e2aea.zip
Introducing rAthena's anonymous data collector. This aims at improving rAthena's overall features by letting we know which options are most and least used.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16785 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common')
-rw-r--r--src/common/socket.c9
-rw-r--r--src/common/socket.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index f8e957788..3d7bb66b4 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -502,8 +502,7 @@ int make_listen_bind(uint32 ip, uint16 port)
return fd;
}
-int make_connection(uint32 ip, uint16 port)
-{
+int make_connection(uint32 ip, uint16 port, bool silent) {
struct sockaddr_in remote_address;
int fd;
int result;
@@ -533,11 +532,13 @@ int make_connection(uint32 ip, uint16 port)
remote_address.sin_addr.s_addr = htonl(ip);
remote_address.sin_port = htons(port);
- ShowStatus("Connecting to %d.%d.%d.%d:%i\n", CONVIP(ip), port);
+ if( !silent )
+ ShowStatus("Connecting to %d.%d.%d.%d:%i\n", CONVIP(ip), port);
result = sConnect(fd, (struct sockaddr *)(&remote_address), sizeof(struct sockaddr_in));
if( result == SOCKET_ERROR ) {
- ShowError("make_connection: connect failed (socket #%d, %s)!\n", fd, error_msg());
+ if( !silent )
+ ShowError("make_connection: connect failed (socket #%d, %s)!\n", fd, error_msg());
do_close(fd);
return -1;
}
diff --git a/src/common/socket.h b/src/common/socket.h
index 3c6cebf0b..3265f6487 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -112,7 +112,7 @@ extern bool session_isActive(int fd);
// Function prototype declaration
int make_listen_bind(uint32 ip, uint16 port);
-int make_connection(uint32 ip, uint16 port);
+int make_connection(uint32 ip, uint16 port, bool silent);
int realloc_fifo(int fd, unsigned int rfifo_size, unsigned int wfifo_size);
int realloc_writefifo(int fd, size_t addition);
int WFIFOSET(int fd, size_t len);