Allow emails as usernames
This commit is contained in:
@@ -550,7 +550,7 @@ void GetAPIMessager::netGetBottleneckStats(char *buf, uint32_t len) {
|
|||||||
const char *id = it->first.c_str();
|
const char *id = it->first.c_str();
|
||||||
const char *data = it->second.c_str();
|
const char *data = it->second.c_str();
|
||||||
|
|
||||||
const char *at = strchr(id, '@');
|
const char *at = strrchr(id, '@');
|
||||||
if (!at)
|
if (!at)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s,
|
|||||||
wordfree(&wexp);
|
wordfree(&wexp);
|
||||||
|
|
||||||
user[0] = '\0';
|
user[0] = '\0';
|
||||||
const char *at = strchr(peerEndpoint.buf, '@');
|
const char *at = strrchr(peerEndpoint.buf, '@');
|
||||||
if (at && at - peerEndpoint.buf > 1 && at - peerEndpoint.buf < 32) {
|
if (at && at - peerEndpoint.buf > 1 && at - peerEndpoint.buf < 32) {
|
||||||
memcpy(user, peerEndpoint.buf, at - peerEndpoint.buf);
|
memcpy(user, peerEndpoint.buf, at - peerEndpoint.buf);
|
||||||
user[at - peerEndpoint.buf] = '\0';
|
user[at - peerEndpoint.buf] = '\0';
|
||||||
@@ -1635,7 +1635,7 @@ void VNCSConnectionST::sendStats(const bool toClient) {
|
|||||||
void VNCSConnectionST::handleFrameStats(rdr::U32 all, rdr::U32 render)
|
void VNCSConnectionST::handleFrameStats(rdr::U32 all, rdr::U32 render)
|
||||||
{
|
{
|
||||||
if (server->apimessager) {
|
if (server->apimessager) {
|
||||||
const char *at = strchr(peerEndpoint.buf, '@');
|
const char *at = strrchr(peerEndpoint.buf, '@');
|
||||||
if (!at)
|
if (!at)
|
||||||
at = peerEndpoint.buf;
|
at = peerEndpoint.buf;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -814,7 +814,7 @@ static void upgradeClientToUdp(const network::GetAPIMessager::action_data &act,
|
|||||||
inet_ntop(AF_INET, &act.udp.ip, buf, 32);
|
inet_ntop(AF_INET, &act.udp.ip, buf, 32);
|
||||||
|
|
||||||
const char * const who = (*ci)->getPeerEndpoint();
|
const char * const who = (*ci)->getPeerEndpoint();
|
||||||
const char *start = strchr(who, '@');
|
const char *start = strrchr(who, '@');
|
||||||
if (!start)
|
if (!start)
|
||||||
continue;
|
continue;
|
||||||
start++;
|
start++;
|
||||||
|
|||||||
Reference in New Issue
Block a user