[Msnphelper-cvs-commit] CVS: msnphelper/src ConnectionHandler.cs,1.5,1.6 MSNPEventArgs.cs,1.1.1.1,1.
Status: Alpha
Brought to you by:
cmyers
|
From: Chad M. <cm...@us...> - 2002-03-20 05:37:29
|
Update of /cvsroot/msnphelper/msnphelper/src
In directory usw-pr-cvs1:/tmp/cvs-serv25022/src
Modified Files:
ConnectionHandler.cs MSNPEventArgs.cs MimeMessage.cs
Request.cs SwitchboardConnectionHandler.cs
Log Message:
Fixed the 2-line message bug. Forgot license at top of EventArgs and MimeMessage
Index: ConnectionHandler.cs
===================================================================
RCS file: /cvsroot/msnphelper/msnphelper/src/ConnectionHandler.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ConnectionHandler.cs 18 Mar 2002 03:50:45 -0000 1.5
--- ConnectionHandler.cs 20 Mar 2002 05:37:26 -0000 1.6
***************
*** 401,407 ****
String messageToSend;
if( request.Parameters != null )
! messageToSend = request.Command + " " + transID.ToString() + " " + request.Parameters + "\r\n";
else
! messageToSend = request.Command + " " + transID.ToString() + "\r\n";
byte[] bytesToSend = Encoding.ASCII.GetBytes(messageToSend);
--- 401,410 ----
String messageToSend;
if( request.Parameters != null )
! messageToSend = request.Command + " " + transID.ToString() + " " + request.Parameters;
else
! messageToSend = request.Command + " " + transID.ToString();
!
! if( request.IncludeCRLF )
! messageToSend += "\r\n";
byte[] bytesToSend = Encoding.ASCII.GetBytes(messageToSend);
***************
*** 437,441 ****
m_SocketReadResult.IsCompleted )
{
! byte[] responseBytes = new byte[8024];
m_SocketReadResult = m_Socket.BeginReceive(
--- 440,444 ----
m_SocketReadResult.IsCompleted )
{
! byte[] responseBytes = new byte[512];
m_SocketReadResult = m_Socket.BeginReceive(
Index: MSNPEventArgs.cs
===================================================================
RCS file: /cvsroot/msnphelper/msnphelper/src/MSNPEventArgs.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** MSNPEventArgs.cs 15 Mar 2002 01:12:37 -0000 1.1.1.1
--- MSNPEventArgs.cs 20 Mar 2002 05:37:26 -0000 1.2
***************
*** 1,2 ****
--- 1,31 ----
+ /*
+ * (standard BSD license)
+ *
+ * Copyright (c) 2002, Chad Myers, et al.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary form
+ * must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with
+ * the distribution. Neither the name of SourceForge, nor Microsoft nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
using System;
Index: MimeMessage.cs
===================================================================
RCS file: /cvsroot/msnphelper/msnphelper/src/MimeMessage.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** MimeMessage.cs 15 Mar 2002 01:12:37 -0000 1.1.1.1
--- MimeMessage.cs 20 Mar 2002 05:37:26 -0000 1.2
***************
*** 1,2 ****
--- 1,31 ----
+ /*
+ * (standard BSD license)
+ *
+ * Copyright (c) 2002, Chad Myers, et al.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer. Redistributions in binary form
+ * must reproduce the above copyright notice, this list of conditions and the
+ * following disclaimer in the documentation and/or other materials provided with
+ * the distribution. Neither the name of SourceForge, nor Microsoft nor the names
+ * of its contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
using System;
using System.Collections;
Index: Request.cs
===================================================================
RCS file: /cvsroot/msnphelper/msnphelper/src/Request.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Request.cs 16 Mar 2002 21:09:51 -0000 1.2
--- Request.cs 20 Mar 2002 05:37:26 -0000 1.3
***************
*** 44,47 ****
--- 44,48 ----
String m_Command; // The command to send
String m_Parameters; // Extra parameters if necessary
+ bool m_IncludeCRLF = true;
/**********************************************/
***************
*** 60,63 ****
--- 61,74 ----
}
+ /// <summary>
+ /// Convenience constructor for requests that don't require
+ /// a trailing CRLF (such as MSG)
+ /// </summary>
+ public Request(String command, String parameters, bool includeCRLF) :
+ this(command, parameters)
+ {
+ m_IncludeCRLF = includeCRLF;
+ }
+
/**********************************************/
// Properties
***************
*** 65,68 ****
--- 76,80 ----
public String Command{ get{ return m_Command; } }
public String Parameters{ get{ return m_Parameters; } }
+ public bool IncludeCRLF{ get{ return m_IncludeCRLF; } }
/**********************************************/
Index: SwitchboardConnectionHandler.cs
===================================================================
RCS file: /cvsroot/msnphelper/msnphelper/src/SwitchboardConnectionHandler.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SwitchboardConnectionHandler.cs 17 Mar 2002 20:52:21 -0000 1.5
--- SwitchboardConnectionHandler.cs 20 Mar 2002 05:37:26 -0000 1.6
***************
*** 355,364 ****
internal void SendMessage(String message)
{
! string headers = "MIME-Version: 1.0\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\n";
! int length = headers.Length + message.Length + 2;
! string commandParams = "U " + length.ToString() + "\r\n" + headers + message;
! AddSessionRequest(new Request(MSG, commandParams));
}
--- 355,366 ----
internal void SendMessage(String message)
{
! String headers = "MIME-Version: 1.0\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\n";
! String totalMessage = headers + message;
! int length = totalMessage.Length;
! String commandParams = "U " + length.ToString() + "\r\n" + totalMessage;
!
! AddSessionRequest(new Request(MSG, commandParams, false));
}
***************
*** 369,373 ****
internal void SendMessage(MimeMessage message)
{
! string headers = "";
IDictionary headersDict = message.Headers;
--- 371,375 ----
internal void SendMessage(MimeMessage message)
{
! String headers = "";
IDictionary headersDict = message.Headers;
***************
*** 379,387 ****
headers += "\r\n";
! int length = headers.Length + message.Body.Length + 2;
!
! string commandParams = "U " + length.ToString() + "\r\n" + headers + message;
! AddSessionRequest(new Request(MSG, commandParams));
}
--- 381,390 ----
headers += "\r\n";
! String totalMessage = headers + message;
! int length = totalMessage.Length;
! String commandParams = "U " + length.ToString() + "\r\n" + totalMessage;
!
! AddSessionRequest(new Request(MSG, commandParams, false));
}
|