Open GoogleCodeExporter opened 9 years ago
I've fixed procedure ApiEntityRow in a file ApiEntityRow.cs
public ApiEntityRow(string dataRow)
{
//!re=.id=*100004B=name=TOP=parent=global-out=packet-mark==limit-at=10000000=queue=wireless-default=priority=3=max-limit=15000000=burst-limit=0=burst-threshold=0=burst-time=00:00:00=bytes=0=packets=0=dropped=0=rate=0=packet-rate=0=queued-packets=0=queued-bytes=0=lends=0=borrows=0=pcq-queues=0=disabled=true=invalid=true
DataRow = dataRow;
if (!dataRow.StartsWith("!re", StringComparison.OrdinalIgnoreCase))
throw new TikResponseParseException("Invalid response row: {0}", dataRow);
string[] items = dataRow.Split('\n');
string[] parts =new string[1];
for (int i = 1; i < (items.Length); i++)
{
if (!items[i].StartsWith(SEPARATOR, StringComparison.OrdinalIgnoreCase))
{
//throw new TikResponseParseException("Some value in dataRow does not start with '{0}'. Row: {1}", SEPARATOR, dataRow);
parts[1]+=items[i];
}
else
{
parts = items[i].Substring(1).Split(new char[] { '=' }, 2);
if (parts.Length != 2)
throw new TikResponseParseException("Invalid response format in datarow '{0}'. Expected '{1}attrName{1}attrValue'", items[i], SEPARATOR);
}
if (i == items.Length-1)
this.items.Add(parts[0], parts[1]);
else
if(items[i+1].StartsWith(SEPARATOR, StringComparison.OrdinalIgnoreCase))
this.items.Add(parts[0], parts[1]);
}
}
It works for me. Sorry for my coding. i'm using C# second day =)
Original comment by soroki...@gmail.com
on 26 May 2011 at 8:38
Thanx for report. It will be fixed in next release.
Danik
PS: I have to addopt somehow idea that some system characters could be part of
content - thanks again for betatesting.
Original comment by daniel.f...@gmail.com
on 4 Jun 2011 at 6:49
Original issue reported on code.google.com by
soroki...@gmail.com
on 26 May 2011 at 10:40