diff --git a/dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs b/dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs index 9044f1a00..9322238df 100644 --- a/dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs +++ b/dotnet/src/dotnetframework/GxClasses/Data/GXDataCommon.cs @@ -2001,10 +2001,7 @@ protected override string BuildConnectionString(string datasourceName, string us MAX_TRIES = 100; //Max Pool Size default de ado.net else MAX_TRIES = Convert.ToInt32(maxpoolSize); - GXLogging.Debug(log, "MAX_TRIES=" + MAX_TRIES); - return connstr; - } #if !NETCORE diff --git a/dotnet/src/dotnetframework/GxClasses/Data/GXDataMysqlConnector.cs b/dotnet/src/dotnetframework/GxClasses/Data/GXDataMysqlConnector.cs index 40848b04d..14ed3a8be 100644 --- a/dotnet/src/dotnetframework/GxClasses/Data/GXDataMysqlConnector.cs +++ b/dotnet/src/dotnetframework/GxClasses/Data/GXDataMysqlConnector.cs @@ -136,7 +136,6 @@ protected override string BuildConnectionString(string datasourceName, string us string maxpoolSize = GetParameterValue(connstr, "Max Pool Size"); if (String.IsNullOrEmpty(maxpoolSize)) MAX_TRIES = 100; else MAX_TRIES = Convert.ToInt32(maxpoolSize); - GXLogging.Debug(log, "MAX_TRIES=" + MAX_TRIES); return connstr; } public override bool AllowsDuplicateParameters diff --git a/dotnet/src/dotnetframework/GxMail/POP3Session.cs b/dotnet/src/dotnetframework/GxMail/POP3Session.cs index 9a2a91e4a..75be7b0a3 100644 --- a/dotnet/src/dotnetframework/GxMail/POP3Session.cs +++ b/dotnet/src/dotnetframework/GxMail/POP3Session.cs @@ -391,7 +391,7 @@ private string getMessageUid(string response) private void CheckLogin() { SendAndWaitResponse("USER " + userName, MailConstants.MAIL_ServerReplyInvalid); - SendAndWaitResponse("PASS " + password, MailConstants.MAIL_ServerReplyInvalid); + SendPrivateDataAndWaitResponse("PASS " + password, MailConstants.MAIL_ServerReplyInvalid, "PASS xxx"); count = GetIntValue("STAT"); @@ -534,50 +534,63 @@ private void Skip() #endregion #region Send Methods + private void SendPrivateDataAndWaitResponse(string cmdMsg, short errorCode, string traceMsg) + { + SendPrivateDataTCP(cmdMsg + CRLF, traceMsg); + WaitResponse(errorCode); + } + + private void SendAndWaitResponse(string cmdMsg, short errorCode) { SendTCP(cmdMsg + CRLF); - + WaitResponse(errorCode); + } + private void WaitResponse(short errorCode) + { string response = GetResponse(); - GXLogging.Debug(log,"SendAndWait Server response: " + response); + GXLogging.Debug(log, "SendAndWait Server response: " + response); string serverResponse = response; int firstBlank = serverResponse.IndexOf(" "); - if(firstBlank != -1) + if (firstBlank != -1) { serverResponse = serverResponse.Substring(firstBlank).Trim(); } - if(response.StartsWith("-ERR")) + if (response.StartsWith("-ERR")) { - GXLogging.Error(log,"Command error, server response: " + serverResponse); - throw new GXMailException("Server replied with an error: " + serverResponse, MailConstants.MAIL_ServerRepliedErr); + GXLogging.Error(log, "Command error, server response: " + serverResponse); + throw new GXMailException("Server replied with an error: " + serverResponse, MailConstants.MAIL_ServerRepliedErr); } - if(!response.StartsWith("+OK")) + if (!response.StartsWith("+OK")) { - GXLogging.Error(log,"Command error, server response: " + serverResponse); + GXLogging.Error(log, "Command error, server response: " + serverResponse); throw new GXMailException(response, errorCode); } } - + private void SendTCP(string cmd) { - GXLogging.Debug(log,"Command: " + cmd); + SendPrivateDataTCP(cmd, cmd); + } + private void SendPrivateDataTCP(string cmd, string traceCmd) + { + GXLogging.Debug(log, "Command: " + traceCmd); try { byte[] toSend = Encoding.ASCII.GetBytes(cmd); int sent = connection.Send(toSend); - while(sent != toSend.Length) + while (sent != toSend.Length) { sent += connection.Send(toSend, sent, toSend.Length - sent, SocketFlags.None); } } - catch(Exception exc) + catch (Exception exc) { - GXLogging.Error(log,"Error sending command", exc); - throw new GXMailException(exc.Message, MailConstants.MAIL_ConnectionLost); + GXLogging.Error(log, "Error sending command", exc); + throw new GXMailException(exc.Message, MailConstants.MAIL_ConnectionLost); } } - private void SendNL(string str) { SendTCP(str + CRLF); diff --git a/dotnet/src/dotnetframework/GxMail/SMTPSession.cs b/dotnet/src/dotnetframework/GxMail/SMTPSession.cs index 4314ac84d..f8f26847c 100644 --- a/dotnet/src/dotnetframework/GxMail/SMTPSession.cs +++ b/dotnet/src/dotnetframework/GxMail/SMTPSession.cs @@ -425,7 +425,7 @@ private void CheckLogin(bool startTLS) } SendAndWaitResponse("AUTH LOGIN", "334", MAIL_AuthenticationError); SendAndWaitResponse(ToBase64(userName), "334", MAIL_AuthenticationError); - SendAndWaitResponse(ToBase64(password), "235", MAIL_PasswordRefused); + SendPrivateDataAndWaitResponse(ToBase64(password), "235", MAIL_PasswordRefused, "xxx"); } else { @@ -510,29 +510,34 @@ private void SendAndWaitResponse(string cmdMsg) SendAndWaitResponse(cmdMsg, "2", 0); } - private void SendAndWaitResponse(string cmdMsg, string okResponse) - { - SendAndWaitResponse(cmdMsg, okResponse, 0); - } - - private void SendAndWaitResponse(string cmdMsg, string okResponse, short errorCode) + private void SendPrivateDataAndWaitResponse(string cmdMsg, string okResponse, short errorCode, string traceCmd) + { + SendPrivateDataTCP(cmdMsg + CRLF, traceCmd); + WaitResponse(okResponse, errorCode); + } + + private void SendAndWaitResponse(string cmdMsg, string okResponse, short errorCode) { SendTCP(cmdMsg + CRLF); - - string response = GetResponse(); - GXLogging.Debug(log,"Server response: " + response); - if (!response.Equals(okResponse)) - { - if (!response.StartsWith(okResponse)) - { - SendNL("RSET"); - GXLogging.Error(log,"Command error, server response: " + response); - throw new GXMailException(response, errorCode); - } - } - } - - private void SendText(string text) + WaitResponse(okResponse, errorCode); + + } + private void WaitResponse(string okResponse, short errorCode) + { + + string response = GetResponse(); + GXLogging.Debug(log, "Server response: " + response); + if (!response.Equals(okResponse)) + { + if (!response.StartsWith(okResponse)) + { + SendNL("RSET"); + GXLogging.Error(log, "Command error, server response: " + response); + throw new GXMailException(response, errorCode); + } + } + } + private void SendText(string text) { StringBuilder strBuilder = new StringBuilder(""); @@ -624,24 +629,27 @@ private void SendEncodedNL(string cmd, Encoding encoding) private void SendTCP(string cmd) { - GXLogging.Debug(log,"Command: " + cmd); - try - { - byte[] toSend = Encoding.Default.GetBytes(cmd); - int sent = connection.Send(toSend); - while (sent != toSend.Length) - { - sent += connection.Send(toSend, sent, toSend.Length - sent, SocketFlags.None); - } - } - catch (Exception exc) - { - GXLogging.Error(log,"Error sending command", exc); - throw new GXMailException(exc.Message, MAIL_ConnectionLost); - } - } - - private void SendRecipientList(GXMailRecipientCollection recipients) + SendPrivateDataTCP(cmd, cmd); + } + private void SendPrivateDataTCP(string cmd, string traceCmd) + { + GXLogging.Debug(log, "Command: " + traceCmd); + try + { + byte[] toSend = Encoding.Default.GetBytes(cmd); + int sent = connection.Send(toSend); + while (sent != toSend.Length) + { + sent += connection.Send(toSend, sent, toSend.Length - sent, SocketFlags.None); + } + } + catch (Exception exc) + { + GXLogging.Error(log, "Error sending command", exc); + throw new GXMailException(exc.Message, MAIL_ConnectionLost); + } + } + private void SendRecipientList(GXMailRecipientCollection recipients) { try {