X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsocket.cpp;h=d4cdb0a18f41903510d1732596da69ac84af47a7;hb=4ac0ccc06ce0cafea2549f51881cba0c44463d9c;hp=923ca5848695bde98d7942ed1a6ce7ecb27f44cd;hpb=85f9d57f0f172c0db12d037ac018d7ff33a64975;p=user%2Fhenk%2Fcode%2Finspircd.git 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(); } -