freerdp1: coding style and ifdef change

This commit is contained in:
Jay Sorg 2012-05-12 19:34:43 -07:00
parent c50425032c
commit bd8a75fa7e

View File

@ -70,59 +70,57 @@ lxrdp_connect(struct mod* mod)
if (!ok) if (!ok)
{ {
LLOGLN(0, ("Failure to connect")); LLOGLN(0, ("Failure to connect"));
if(connectErrorCode){ #ifdef ERRORSTART
if (connectErrorCode != 0)
{
char buf[128]; char buf[128];
if(connectErrorCode<ERRORSTART){
if(strerror_r(connectErrorCode,buf,128)!=0){ if (connectErrorCode < ERRORSTART)
{
if (strerror_r(connectErrorCode, buf, 128) != 0)
{
snprintf(buf, 128, "Errorcode from connect : %d", connectErrorCode); snprintf(buf, 128, "Errorcode from connect : %d", connectErrorCode);
} }
}else{ }
switch(connectErrorCode){ else
case PREECONNECTERROR:{ {
switch (connectErrorCode)
{
case PREECONNECTERROR:
snprintf(buf, 128, "The error code from connect is PREECONNECTERROR"); snprintf(buf, 128, "The error code from connect is PREECONNECTERROR");
break; break;
} case UNDEFINEDCONNECTERROR:
case UNDEFINEDCONNECTERROR:{
snprintf(buf, 128, "The error code from connect is UNDEFINEDCONNECTERROR"); snprintf(buf, 128, "The error code from connect is UNDEFINEDCONNECTERROR");
break; break;
} case POSTCONNECTERROR:
case POSTCONNECTERROR:{
snprintf(buf, 128, "The error code from connect is POSTCONNECTERROR"); snprintf(buf, 128, "The error code from connect is POSTCONNECTERROR");
break; break;
} case DNSERROR:
case DNSERROR:{
snprintf(buf, 128, "The DNS system generated an error"); snprintf(buf, 128, "The DNS system generated an error");
break; break;
} case DNSNAMENOTFOUND:
case DNSNAMENOTFOUND:{
snprintf(buf, 128, "The DNS system could not find the specified name"); snprintf(buf, 128, "The DNS system could not find the specified name");
break; break;
} case CONNECTERROR:
case CONNECTERROR:{
snprintf(buf, 128, "A general connect error was returned"); snprintf(buf, 128, "A general connect error was returned");
break; break;
} case MCSCONNECTINITIALERROR:
case MCSCONNECTINITIALERROR:{
snprintf(buf, 128, "The error code from connect is MCSCONNECTINITIALERROR"); snprintf(buf, 128, "The error code from connect is MCSCONNECTINITIALERROR");
break; break;
} case TLSCONNECTERROR:
case TLSCONNECTERROR:{
snprintf(buf, 128, "Error in TLS handshake"); snprintf(buf, 128, "Error in TLS handshake");
break; break;
} case AUTHENTICATIONERROR:
case AUTHENTICATIONERROR:{
snprintf(buf, 128, "Authentication error check your password and username"); snprintf(buf, 128, "Authentication error check your password and username");
break; break;
} default:
default:{
snprintf(buf, 128, "Unhandled Errorcode from connect : %d", connectErrorCode); snprintf(buf, 128, "Unhandled Errorcode from connect : %d", connectErrorCode);
break; break;
} }
} }
}
mod->server_msg(mod, buf, 0); mod->server_msg(mod, buf, 0);
} }
#endif
return 1; return 1;
} }
return 0; return 0;