LIBOMV-492 Fixed up WinGridProxy with all sorts of new goodies, now using VirtualMode for efficiency of time and memory, This version has some new features and probably some new bugs:
* New QuickLaunch bar will (on windows) detect and allow you to launch installed viewers * Custom login url's are now saved for future sessions * Better exception handling in GridProxy git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3224 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
3
Programs/WinGridProxy/AboutBox1.Designer.cs
generated
3
Programs/WinGridProxy/AboutBox1.Designer.cs
generated
@@ -155,13 +155,14 @@
|
||||
// richTextBox1
|
||||
//
|
||||
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.richTextBox1.Enabled = false;
|
||||
this.richTextBox1.Location = new System.Drawing.Point(140, 153);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.ReadOnly = true;
|
||||
this.richTextBox1.Size = new System.Drawing.Size(274, 79);
|
||||
this.richTextBox1.TabIndex = 25;
|
||||
this.richTextBox1.Text = "Written by Jim Radford <jradford@npl.com>\n\nIcons Courtesy of http://www.famfamfam" +
|
||||
".com/lab/icons/silk/\n\nHexbox Control \nhttp://sourceforge.net/projects/hexbox/";
|
||||
this.richTextBox1.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBoxDecodedRequest_LinkClicked);
|
||||
//
|
||||
// AboutBox1
|
||||
//
|
||||
|
||||
@@ -99,5 +99,10 @@ namespace WinGridProxy
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void richTextBoxDecodedRequest_LinkClicked(object sender, LinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(e.LinkText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
783
Programs/WinGridProxy/FormWinGridProxy.Designer.cs
generated
783
Programs/WinGridProxy/FormWinGridProxy.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -118,10 +118,19 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="contextMenuStripSessions.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>555, 17</value>
|
||||
<value>567, 0</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripRemove.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 39</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripSelect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>1116, 0</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripMark.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>762, 0</value>
|
||||
</metadata>
|
||||
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>309, 17</value>
|
||||
<value>321, 0</value>
|
||||
</metadata>
|
||||
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
@@ -173,19 +182,7 @@
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="toolStripFilters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>339, 56</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripRemove.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 56</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripSelect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>1104, 17</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripMark.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>750, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolStripFilters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>339, 56</value>
|
||||
<value>339, 39</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="loadFilterSelectionsToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@@ -234,6 +231,24 @@
|
||||
dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
|
||||
NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
|
||||
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>352, 78</value>
|
||||
</metadata>
|
||||
<data name="toolStripButtonInject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
|
||||
U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
|
||||
VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
|
||||
QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
|
||||
/g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
|
||||
cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
|
||||
3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
|
||||
dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
|
||||
NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
|
||||
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="toolStripMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
@@ -254,6 +269,9 @@
|
||||
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="contextMenuStripCopy.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>939, 0</value>
|
||||
</metadata>
|
||||
<data name="EditToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
@@ -271,11 +289,8 @@
|
||||
AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="contextMenuStripCopy.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>927, 17</value>
|
||||
</metadata>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>226, 17</value>
|
||||
<value>234, 0</value>
|
||||
</metadata>
|
||||
<data name="toolStripDropDownButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
@@ -323,27 +338,54 @@
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>470, 56</value>
|
||||
<value>470, 39</value>
|
||||
</metadata>
|
||||
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>606, 56</value>
|
||||
<value>606, 39</value>
|
||||
</metadata>
|
||||
<metadata name="saveFileDialog2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>746, 56</value>
|
||||
<value>746, 39</value>
|
||||
</metadata>
|
||||
<metadata name="openFileDialog2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>882, 56</value>
|
||||
<value>882, 39</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStripFilterOptions.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 95</value>
|
||||
<value>17, 78</value>
|
||||
</metadata>
|
||||
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>1022, 56</value>
|
||||
<value>1022, 39</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>236, 78</value>
|
||||
</metadata>
|
||||
<metadata name="toolStripLogin.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>210, 56</value>
|
||||
<value>210, 39</value>
|
||||
</metadata>
|
||||
<metadata name="toolStripQuickLaunch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>236, 58</value>
|
||||
</metadata>
|
||||
<data name="buttonLaunchViewer.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
|
||||
U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
|
||||
VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
|
||||
QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
|
||||
/g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
|
||||
cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
|
||||
3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
|
||||
dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
|
||||
NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
|
||||
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="saveFileDialog3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>419, 17</value>
|
||||
<value>431, 0</value>
|
||||
</metadata>
|
||||
<metadata name="timerCleanupCache.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>147, 0</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>25</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -27,32 +27,75 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace WinGridProxy
|
||||
{
|
||||
class ListViewNoFlicker : ListView
|
||||
internal class ListViewNoFlicker : ListView
|
||||
{
|
||||
public ListViewNoFlicker()
|
||||
{
|
||||
|
||||
//Activate double buffering
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
|
||||
{
|
||||
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
|
||||
//Enable the OnNotifyMessage event so we get a chance to filter out
|
||||
// Windows messages before they get to the form's WndProc
|
||||
this.SetStyle(ControlStyles.EnableNotifyMessage, true);
|
||||
this.SetStyle(ControlStyles.EnableNotifyMessage, true);
|
||||
}
|
||||
|
||||
|
||||
protected override void OnNotifyMessage(Message m)
|
||||
{
|
||||
{
|
||||
//private const UInt32 WM_VSCROLL = 0x0115;
|
||||
if (m.Msg == 0x0115)
|
||||
{
|
||||
if (m.WParam.ToInt32().Equals(8))
|
||||
{
|
||||
// Scrollbar scrolling stopped
|
||||
OnScrolling(new ScrollingEventArgs(false));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Scroll starting
|
||||
OnScrolling(new ScrollingEventArgs(true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Filter out the WM_ERASEBKGND message
|
||||
if (m.Msg != 0x14)
|
||||
{
|
||||
base.OnNotifyMessage(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private EventHandler<ScrollingEventArgs> m_Scrolling;
|
||||
private void OnScrolling(ScrollingEventArgs e)
|
||||
{
|
||||
EventHandler<ScrollingEventArgs> handler = m_Scrolling;
|
||||
if (handler != null)
|
||||
handler(this, e);
|
||||
}
|
||||
|
||||
private readonly object m_ScrollingLock = new object();
|
||||
|
||||
[Description("Occurs, when the listview scrolling starts and stops")]
|
||||
public event EventHandler<ScrollingEventArgs> Scrolling
|
||||
{
|
||||
add { lock (m_ScrollingLock) { m_Scrolling += value; } }
|
||||
remove { lock (m_ScrollingLock) { m_Scrolling -= value; } }
|
||||
}
|
||||
}
|
||||
|
||||
public class ScrollingEventArgs : EventArgs
|
||||
{
|
||||
private bool m_Scrolling;
|
||||
public bool Scrolling { get { return m_Scrolling; } set { this.m_Scrolling = value; } }
|
||||
|
||||
public ScrollingEventArgs(bool scrolling)
|
||||
{
|
||||
this.m_Scrolling = scrolling;
|
||||
}
|
||||
}
|
||||
|
||||
public class ListViewItemComparer : IComparer<object>
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("WinGridProxy")]
|
||||
[assembly: AssemblyDescription("Proxy and Packet Analyzer")]
|
||||
[assembly: AssemblyDescription("Proxy server and packet analyzer")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("OpenMetaverse")]
|
||||
[assembly: AssemblyProduct("WinGridProxy")]
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
@@ -128,10 +128,10 @@ namespace WinGridProxy
|
||||
OnCapabilityAdded((CapInfo)de.Value);
|
||||
}
|
||||
|
||||
private void LoginRequest(XmlRpcRequest request)
|
||||
private void LoginRequest(object sender, XmlRpcRequestEventArgs e)
|
||||
{
|
||||
if (OnLoginResponse != null)
|
||||
OnLoginResponse(request, Direction.Outgoing);
|
||||
OnLoginResponse(e.m_Request, Direction.Outgoing);
|
||||
}
|
||||
|
||||
private void LoginResponse(XmlRpcResponse response)
|
||||
|
||||
@@ -40,20 +40,25 @@ namespace WinGridProxy
|
||||
#region Base Class
|
||||
internal abstract class Session
|
||||
{
|
||||
private const string EmptyXml = "<?xml version=\"1.0\"?><Empty>XML representation of this item is not available.</Empty>";
|
||||
private const string EmptyString = "String representation of this item is not available.";
|
||||
private const string EmptyNotation = "Notation representation of this item is not available.";
|
||||
internal const string EmptyXml = "<?xml version=\"1.0\"?><Empty>XML representation of this item is not available.</Empty>";
|
||||
internal const string EmptyString = "String representation of this item is not available.";
|
||||
internal const string EmptyNotation = "Notation representation of this item is not available.";
|
||||
|
||||
public Direction Direction { get; set; }
|
||||
public String Host { get; set; }
|
||||
public String Protocol { get; set; }
|
||||
public String Name { get; set; }
|
||||
public String ContentType { get; set; }
|
||||
|
||||
public int Length { get; set; }
|
||||
public DateTime TimeStamp { get; set; }
|
||||
|
||||
// listview specific stuff, not serialized or deserialized
|
||||
public bool Selected { get; set; }
|
||||
public System.Drawing.Color BackColor { get; set; }
|
||||
|
||||
public Session()
|
||||
{
|
||||
this.TimeStamp = DateTime.UtcNow;
|
||||
this.Host = this.Protocol = this.Name = String.Empty;
|
||||
this.Length = 0;
|
||||
this.ContentType = String.Empty;
|
||||
@@ -167,8 +172,42 @@ namespace WinGridProxy
|
||||
this.Length = packetData.Length;
|
||||
|
||||
int packetEnd = packetData.Length - 1;
|
||||
this.Packet = Packet.BuildPacket(packetData, ref packetEnd, null);
|
||||
this.Name = this.Packet.Type.ToString();
|
||||
|
||||
try
|
||||
{
|
||||
bool msg_zer = ((packetData[0] & Helpers.MSG_ZEROCODED) != 0);
|
||||
bool msg_res = ((packetData[0] & Helpers.MSG_RESENT) != 0);
|
||||
bool msg_rel = ((packetData[0] & Helpers.MSG_RELIABLE) != 0);
|
||||
bool msg_ack = ((packetData[0] & Helpers.MSG_APPENDED_ACKS) != 0);
|
||||
|
||||
if ((packetData[0] & Helpers.MSG_ZEROCODED) != 0)
|
||||
{
|
||||
packetData[0] = 0x00;
|
||||
}
|
||||
|
||||
this.Packet = Packet.BuildPacket(packetData, ref packetEnd, null);
|
||||
|
||||
this.Packet.Header.Resent = msg_res;
|
||||
this.Packet.Header.Reliable = msg_rel;
|
||||
this.Packet.Header.Zerocoded = msg_zer;
|
||||
this.Packet.Header.AppendedAcks = msg_ack;
|
||||
|
||||
this.Name = this.Packet.Type.ToString();
|
||||
}
|
||||
catch (IndexOutOfRangeException ex)
|
||||
{
|
||||
this.Name = ex.Message;
|
||||
}
|
||||
catch (MalformedDataException ex)
|
||||
{
|
||||
this.Name = ex.Message;
|
||||
//throw;
|
||||
}
|
||||
catch (NullReferenceException ex)
|
||||
{
|
||||
this.Name = ex.Message;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -188,8 +227,15 @@ namespace WinGridProxy
|
||||
Direction direction, string uri, string capsKey, String proto)
|
||||
: base()
|
||||
{
|
||||
this.RequestBytes = requestBytes;
|
||||
this.ResponseBytes = responseBytes;
|
||||
if (requestBytes != null)
|
||||
this.RequestBytes = requestBytes;
|
||||
else
|
||||
this.RequestBytes = OpenMetaverse.Utils.EmptyBytes;
|
||||
|
||||
if (responseBytes != null)
|
||||
this.ResponseBytes = responseBytes;
|
||||
else
|
||||
this.ResponseBytes = OpenMetaverse.Utils.EmptyBytes;
|
||||
this.RequestHeaders = requestHeaders;
|
||||
this.ResponseHeaders = responseHeaders;
|
||||
this.Protocol = proto;
|
||||
@@ -392,10 +438,10 @@ namespace WinGridProxy
|
||||
|
||||
public override byte[] Serialize()
|
||||
{
|
||||
OSDMap map = new OSDMap(9);
|
||||
OSDMap map = new OSDMap(5);
|
||||
map["Name"] = OSD.FromString(this.Name);
|
||||
map["Host"] = OSD.FromString(this.Host);
|
||||
map["RequestBytes"] = OSD.FromBinary(this.RequestBytes);
|
||||
map["RequestBytes"] = OSD.FromBinary(this.RequestBytes);
|
||||
map["ResponseBytes"] = OSD.FromBinary(this.ResponseBytes);
|
||||
map["Direction"] = OSD.FromInteger((int)this.Direction);
|
||||
map["ContentType"] = OSD.FromString(this.ContentType);
|
||||
@@ -408,7 +454,8 @@ namespace WinGridProxy
|
||||
rMap[key] = OSD.FromString(this.RequestHeaders[key]);
|
||||
requestHeadersArray.Add(rMap);
|
||||
}
|
||||
map["RequestHeaders"] = requestHeadersArray;
|
||||
if(requestHeadersArray.Count > 0)
|
||||
map["RequestHeaders"] = requestHeadersArray;
|
||||
|
||||
OSDArray responseHeadersArray = new OSDArray();
|
||||
foreach (String key in this.ResponseHeaders.Keys)
|
||||
@@ -417,15 +464,18 @@ namespace WinGridProxy
|
||||
rMap[key] = OSD.FromString(this.ResponseHeaders[key]);
|
||||
responseHeadersArray.Add(rMap);
|
||||
}
|
||||
map["ResponseHeaders"] = responseHeadersArray;
|
||||
if(responseHeadersArray.Count > 0)
|
||||
map["ResponseHeaders"] = responseHeadersArray;
|
||||
|
||||
return OpenMetaverse.Utils.StringToBytes(map.ToString());
|
||||
}
|
||||
|
||||
public override Session Deserialize(byte[] bytes)
|
||||
{
|
||||
var s = OpenMetaverse.Utils.BytesToString(bytes);
|
||||
|
||||
//OSDMap map = (OSDMap)OSDParser.Deserialize(bytes);
|
||||
OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(OpenMetaverse.Utils.BytesToString(bytes));
|
||||
|
||||
this.Name = map["Name"].AsString();
|
||||
this.Host = map["Host"].AsString();
|
||||
this.RequestBytes = map["RequestBytes"].AsBinary();
|
||||
@@ -436,23 +486,30 @@ namespace WinGridProxy
|
||||
this.Protocol = map["Protocol"].AsString();
|
||||
|
||||
this.RequestHeaders = new WebHeaderCollection();
|
||||
OSDArray requestHeadersArray = (OSDArray)map["RequestHeaders"];
|
||||
for (int i = 0; i < requestHeadersArray.Count; i++)
|
||||
if (map.ContainsKey("RequestHeaders"))
|
||||
{
|
||||
OSDMap rMap = (OSDMap)requestHeadersArray[i];
|
||||
foreach (string key in rMap.Keys)
|
||||
OSDArray requestHeadersArray = (OSDArray)map["RequestHeaders"];
|
||||
for (int i = 0; i < requestHeadersArray.Count; i++)
|
||||
{
|
||||
this.RequestHeaders.Add(key, rMap[key].AsString());
|
||||
OSDMap rMap = (OSDMap)requestHeadersArray[i];
|
||||
foreach (string key in rMap.Keys)
|
||||
{
|
||||
this.RequestHeaders.Add(key, rMap[key].AsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.ResponseHeaders = new WebHeaderCollection();
|
||||
OSDArray responseHeadersArray = (OSDArray)map["ResponseHeaders"];
|
||||
for (int i = 0; i < responseHeadersArray.Count; i++)
|
||||
if (map.ContainsKey("ResponseHeaders"))
|
||||
{
|
||||
OSDMap rMap = (OSDMap)responseHeadersArray[i];
|
||||
foreach (string key in rMap.Keys)
|
||||
OSDArray responseHeadersArray = (OSDArray)map["ResponseHeaders"];
|
||||
for (int i = 0; i < responseHeadersArray.Count; i++)
|
||||
{
|
||||
this.ResponseHeaders.Add(key, rMap[key].AsString());
|
||||
OSDMap rMap = (OSDMap)responseHeadersArray[i];
|
||||
foreach (string key in rMap.Keys)
|
||||
{
|
||||
this.ResponseHeaders.Add(key, rMap[key].AsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,18 +559,17 @@ namespace WinGridProxy
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToXml(Direction direction)
|
||||
{
|
||||
return base.ToXml(direction);
|
||||
|
||||
//if (direction == this.Direction)
|
||||
//{
|
||||
// return this.Data.ToString();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// return base.ToXml(direction);
|
||||
//}
|
||||
if (direction == this.Direction)
|
||||
{
|
||||
return this.Data.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.ToXml(direction);
|
||||
}
|
||||
}
|
||||
|
||||
public override byte[] ToBytes(Direction direction)
|
||||
@@ -691,8 +747,8 @@ namespace WinGridProxy
|
||||
this.Direction = (Direction)map["Direction"].AsInteger();
|
||||
this.ContentType = map["ContentType"].AsString();
|
||||
this.Protocol = map["Protocol"].AsString();
|
||||
|
||||
this.Length = ResponseBytes.Length;
|
||||
|
||||
if (map.ContainsKey("ResponseHeaders"))
|
||||
{
|
||||
this.ResponseHeaders = new WebHeaderCollection();
|
||||
|
||||
Reference in New Issue
Block a user