diff --git a/util/socket.cpp b/util/socket.cpp index c7379470..29b02cd1 100644 --- a/util/socket.cpp +++ b/util/socket.cpp @@ -216,8 +216,9 @@ unsigned int Socket::Connection::dataDown(){ } /// Returns a std::string of stats, ended by a newline. -std::string Socket::Connection::getStats(){ - return getHost() + uint2string(time(0) - conntime) + " " + uint2string(up) + uint2string(down) + "\n"; +/// Requires the current connector name as an argument. +std::string Socket::Connection::getStats(std::string C){ + return getHost() + " " + C + " " + uint2string(time(0) - conntime) + " " + uint2string(up) + " " + uint2string(down) + "\n"; } /// Writes data to socket. This function blocks if the socket is blocking and all data cannot be written right away. diff --git a/util/socket.h b/util/socket.h index b1238abc..a7a16dc9 100644 --- a/util/socket.h +++ b/util/socket.h @@ -52,7 +52,7 @@ namespace Socket{ std::string getError(); ///< Returns a string describing the last error that occured. unsigned int dataUp(); ///< Returns total amount of bytes sent. unsigned int dataDown(); ///< Returns total amount of bytes received. - std::string getStats(); ///< Returns a std::string of stats, ended by a newline. + std::string getStats(std::string C); ///< Returns a std::string of stats, ended by a newline. friend class Server; bool Error; ///< Set to true if a socket error happened. bool Blocking; ///< Set to true if a socket is currently or wants to be blocking.