git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Невеличкий рефакторинг роботи з повідомленнями
[stg.git]
/
projects
/
rscriptd
/
listener.cpp
diff --git
a/projects/rscriptd/listener.cpp
b/projects/rscriptd/listener.cpp
index aca5da445c4dec4346d4c38dc9cd0374313f7c56..82dd631855d3272b5890b7c7309a207f9483dc8d 100644
(file)
--- a/
projects/rscriptd/listener.cpp
+++ b/
projects/rscriptd/listener.cpp
@@
-162,9
+162,9
@@
return false;
//-----------------------------------------------------------------------------
void * LISTENER::Run(void * d)
{
//-----------------------------------------------------------------------------
void * LISTENER::Run(void * d)
{
-LISTENER *
ia
= static_cast<LISTENER *>(d);
+LISTENER *
listener
= static_cast<LISTENER *>(d);
-
ia
->Runner();
+
listener
->Runner();
return NULL;
}
return NULL;
}
@@
-183,9
+183,9
@@
receiverStopped = true;
//-----------------------------------------------------------------------------
void * LISTENER::RunProcessor(void * d)
{
//-----------------------------------------------------------------------------
void * LISTENER::RunProcessor(void * d)
{
-LISTENER *
ia
= static_cast<LISTENER *>(d);
+LISTENER *
listener
= static_cast<LISTENER *>(d);
-
ia
->ProcessorRunner();
+
listener
->ProcessorRunner();
return NULL;
}
return NULL;
}
@@
-215,8
+215,6
@@
if (listenSocket < 0)
return true;
}
return true;
}
-printfd(__FILE__, "Port: %d\n", port);
-
struct sockaddr_in listenAddr;
listenAddr.sin_family = AF_INET;
listenAddr.sin_port = htons(port);
struct sockaddr_in listenAddr;
listenAddr.sin_family = AF_INET;
listenAddr.sin_port = htons(port);
@@
-250,7
+248,7
@@
RS_PACKET_HEADER packetHead;
iov[0].iov_base = reinterpret_cast<char *>(&packetHead);
iov[0].iov_len = sizeof(packetHead);
iov[1].iov_base = buffer;
iov[0].iov_base = reinterpret_cast<char *>(&packetHead);
iov[0].iov_len = sizeof(packetHead);
iov[1].iov_base = buffer;
-iov[1].iov_len = sizeof(buffer);
+iov[1].iov_len = sizeof(buffer)
- sizeof(packetHead)
;
size_t dataLen = 0;
while (dataLen < sizeof(buffer))
size_t dataLen = 0;
while (dataLen < sizeof(buffer))
@@
-321,7
+319,7
@@
if (strncmp((char *)packetTail.magic, RS_ID, RS_MAGIC_LEN))
}
std::stringstream params;
}
std::stringstream params;
-params <<
data.login <<
" "
+params <<
"\"" << data.login << "\
" "
<< inet_ntostring(data.ip) << " "
<< data.id << " "
<< (char *)packetTail.params;
<< inet_ntostring(data.ip) << " "
<< data.id << " "
<< (char *)packetTail.params;