git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added missing method.
[stg.git]
/
projects
/
stargazer
/
plugins
/
configuration
/
sgconfig
/
rsconf.cpp
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
index a4915e397cc950c4a1e8f095f64f998a7db06d46..9b448f6cede881e7c7df4fc6275a9f6b3fb0d798 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
+++ b/
projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
@@
-57,7
+57,7
@@
enum
//-----------------------------------------------------------------------------
int CONFIGPROTO::Prepare()
{
//-----------------------------------------------------------------------------
int CONFIGPROTO::Prepare()
{
-
list<
string> ansList; //óÀÄÁ ÂÕÄÅÔ ÐÏÍÅÝÅÎ ÏÔ×ÅÔ ÄÌÑ ÍÅÎÅÄÖÅÒÁ ËÌÉÅÎÔÏ×
+
std::list<std::
string> ansList; //óÀÄÁ ÂÕÄÅÔ ÐÏÍÅÝÅÎ ÏÔ×ÅÔ ÄÌÑ ÍÅÎÅÄÖÅÒÁ ËÌÉÅÎÔÏ×
int res;
struct sockaddr_in listenAddr;
int res;
struct sockaddr_in listenAddr;
@@
-86,7
+86,7
@@
int lng = 1;
if (0 != setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, &lng, 4))
{
if (0 != setsockopt(listenSocket, SOL_SOCKET, SO_REUSEADDR, &lng, 4))
{
- errorStr = "Setsockopt failed. " + string(strerror(errno));
+ errorStr = "Setsockopt failed. " + st
d::st
ring(strerror(errno));
logger("setsockopt error: %s", strerror(errno));
return -1;
}
logger("setsockopt error: %s", strerror(errno));
return -1;
}
@@
-253,7
+253,7
@@
while (pos < stgHdrLen)
SendError("Bad request");
return -1;
}
SendError("Bad request");
return -1;
}
-
int ret = recv(sock, &buf[pos], stgHdrLen - pos
, 0);
+
ssize_t ret = recv(sock, &buf[pos], static_cast<int>(stgHdrLen) - static_cast<int>(pos)
, 0);
if (ret <= 0)
{
if (ret < 0)
if (ret <= 0)
{
if (ret < 0)
@@
-314,7
+314,7
@@
while (pos < ADM_LOGIN_LEN) {
return ENODATA;
}
return ENODATA;
}
-
int ret = recv(sock, &login[pos], ADM_LOGIN_LEN - pos
, 0);
+
ssize_t ret = recv(sock, &login[pos], ADM_LOGIN_LEN - static_cast<int>(pos)
, 0);
if (ret <= 0)
{
if (ret <= 0)
{
@@
-364,7
+364,7
@@
while (pos < ADM_LOGIN_LEN)
return ENODATA;
}
return ENODATA;
}
-
int ret = recv(sock, &loginS[pos], ADM_LOGIN_LEN - pos
, 0);
+
ssize_t ret = recv(sock, &loginS[pos], ADM_LOGIN_LEN - static_cast<int>(pos)
, 0);
if (ret <= 0)
{
if (ret <= 0)
{
@@
-452,7
+452,7
@@
while (1)
break;
}
break;
}
-
int ret = recv(sock, &bufferS[pos], sizeof(bufferS) - pos
, 0);
+
ssize_t ret = recv(sock, &bufferS[pos], sizeof(bufferS) - static_cast<int>(pos)
, 0);
if (ret < 0)
{
// Network error
if (ret < 0)
{
// Network error
@@
-486,12
+486,12
@@
while (1)
return SendDataAnswer(sock);
}
}
return SendDataAnswer(sock);
}
}
-return 0;
+
//
return 0;
}
//-----------------------------------------------------------------------------
int CONFIGPROTO::SendDataAnswer(int sock)
{
}
//-----------------------------------------------------------------------------
int CONFIGPROTO::SendDataAnswer(int sock)
{
-
list<
string>::iterator li;
+
std::list<std::
string>::iterator li;
li = answerList.begin();
BLOWFISH_CTX ctx;
li = answerList.begin();
BLOWFISH_CTX ctx;
@@
-514,7
+514,7
@@
while (li != answerList.end())
if (n % 8 == 0)
{
EncodeString(buffS, buff, &ctx);
if (n % 8 == 0)
{
EncodeString(buffS, buff, &ctx);
- int ret = s
end(sock, buffS, 8, 0
);
+ int ret = s
tatic_cast<int>(send(sock, buffS, 8, 0)
);
if (ret < 0)
{
return -1;
if (ret < 0)
{
return -1;
@@
-534,7
+534,7
@@
EncodeString(buffS, buff, &ctx);
answerList.clear();
answerList.clear();
-return s
end(sock, buffS, 8, 0
);
+return s
tatic_cast<int>(send(sock, buffS, 8, 0)
);
}
//-----------------------------------------------------------------------------
void CONFIGPROTO::SendError(const char * text)
}
//-----------------------------------------------------------------------------
void CONFIGPROTO::SendError(const char * text)