summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 21:58:54 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 21:58:54 +0000
commit4ac0ccc06ce0cafea2549f51881cba0c44463d9c (patch)
tree762a66837c905f5be0fd936a25e9e4ade8232703 /src/socket.cpp
parent4fa0251cfb55dce9511a4faf00eb7545b74a7f18 (diff)
Convert more by-values to const references, optimise ConfigReader a bit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3606 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/socket.cpp b/src/socket.cpp
index 923ca5848..d4cdb0a18 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -59,10 +59,9 @@ InspSocket::InspSocket(int newfd, char* ip)
socket_ref[this->fd] = this;
}
-InspSocket::InspSocket(std::string ahost, int aport, bool listening, unsigned long maxtime)
+InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsigned long maxtime)
+ : fd(-1), host(ahost)
{
- this->fd = -1;
- this->host = ahost;
this->outbuffer.clear();
if (listening) {
if ((this->fd = OpenTCPSocket()) == ERROR)
@@ -242,7 +241,7 @@ char* InspSocket::Read()
// It will either write all of the data, or an undefined amount.
// If an undefined amount is written the connection has failed
// and should be aborted.
-int InspSocket::Write(std::string data)
+int InspSocket::Write(const std::string &data)
{
/* Try and append the data to the back of the queue, and send it on its way
*/
@@ -372,4 +371,3 @@ InspSocket::~InspSocket()
{
this->Close();
}
-