Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions mdstcpip/mdsipshr/Connections.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ int AcceptConnection(char *protocol, char *info_name, SOCKET readfd, void *info,
*usr = NULL;
Connection *c = newConnection(protocol);
INIT_STATUS_ERROR;
int auth_status = status;
if (c)
{
Message *msg;
Expand All @@ -535,9 +536,9 @@ int AcceptConnection(char *protocol, char *info_name, SOCKET readfd, void *info,
}
c->rm_user = user;
user_p = user ? user : "?";
status = authorize_client(c, user_p);
auth_status = authorize_client(c, user_p);
// SET COMPRESSION //
if (STATUS_OK)
if (IS_OK(auth_status))
{
const int max_version = get_max_version();
c->compression_level = msg->h.status & 0xf;
Expand All @@ -558,7 +559,11 @@ int AcceptConnection(char *protocol, char *info_name, SOCKET readfd, void *info,
// reply to client //
status = SendMdsMsgC(c, msg, 0);
free(msg);
if (STATUS_OK)
// SsINTERNAL has low order bit set so is erroneously treated as OK.
if (status == SsINTERNAL) {
status = MDSplusERROR;
}
if (STATUS_OK && IS_OK(auth_status))
{
if (usr)
*usr = strdup(user_p);
Expand Down