Added error handling in case the stream-type autodetection goes wrong.
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 4m40s

This commit is contained in:
Fey 2026-01-10 17:40:30 +01:00
parent fb34d7d21c
commit 4bb26cef25
4 changed files with 49 additions and 14 deletions

View File

@ -514,6 +514,18 @@ namespace skyscraper5.Data
string filename = String.Format("/SSDP/{0}.xml", ssdpDevice.UniqueServiceName.SanitizeFileName()); string filename = String.Format("/SSDP/{0}.xml", ssdpDevice.UniqueServiceName.SanitizeFileName());
byte[] bytes = GetObject(filename); byte[] bytes = GetObject(filename);
return bytes; return bytes;
} }
public bool TestForSisDsaci(int value1, int value2, ushort groupId, int versionNumber)
{
string filename = String.Format("DVB-SIS/{0}/{1}/Group{2}_Version{3}.xml");
return FileExists(filename);
}
public void StoreSisDsaci(int value1, int value2, ushort currentDsaGroupId, int versionNumber, Stream dsaci)
{
string filename = String.Format("DVB-SIS/{0}/{1}/Group{2}_Version{3}.xml");
WriteObject(filename, dsaci);
}
} }
} }

View File

@ -118,6 +118,7 @@ public class GseWithRollingSyncByteReader : IMisHandler
{ {
byte[] gseDataBytes = fragments[gsePacket.FragmentId.Value].GetGseDataBytes(); byte[] gseDataBytes = fragments[gsePacket.FragmentId.Value].GetGseDataBytes();
HandleAssembledFrame(fragments[gsePacket.FragmentId.Value].ProtocolType, gseDataBytes, fragments[gsePacket.FragmentId.Value].Label); HandleAssembledFrame(fragments[gsePacket.FragmentId.Value].ProtocolType, gseDataBytes, fragments[gsePacket.FragmentId.Value].Label);
return;
} }
} }

View File

@ -64,7 +64,15 @@ class MisHandlerProxy : IMisHandler
state = 3; state = 3;
break; break;
case 3: case 3:
misHandler.PushFrame(bbHeader, readOnlySpan); try
{
misHandler.PushFrame(bbHeader, readOnlySpan);
}
catch (Exception e)
{
logger.ErrorFormat("An error occurred while handling a GS packet. This means that the stream type autodetection guessed wrong.");
OnUnknownStreamFormat();
}
break; break;
default: default:
if (!unknownStateError) if (!unknownStateError)
@ -145,21 +153,35 @@ class MisHandlerProxy : IMisHandler
SucessfulDetection(DetectedGsType.GseWithRollingSyncByte); SucessfulDetection(DetectedGsType.GseWithRollingSyncByte);
return true; return true;
} }
} }
logger.WarnFormat("MIS {0} has an unknown stream type. The IP packet detection algorithm from older skyscraper8 versions will be used. For further analysis, please consider submitting a sample of this stream.", Context.GetMisId()); OnUnknownStreamFormat();
misHandler = new IPv4PacketBruteforce(Context); return false;
return false;
} }
private void DrainQueue() private void DrainQueue()
{ {
while (waitingPackets.Count > 0) try
{ {
Tuple<BBHeader, byte[]> dequeue = waitingPackets.Dequeue(); while (waitingPackets.Count > 0)
misHandler.PushFrame(dequeue.Item1, dequeue.Item2); {
} Tuple<BBHeader, byte[]> dequeue = waitingPackets.Dequeue();
waitingPackets = null; misHandler.PushFrame(dequeue.Item1, dequeue.Item2);
}
waitingPackets = null;
}
catch (Exception ex)
{
logger.ErrorFormat("While trying to handle the buffered GS packets, an error occurred. This means that the stream type autodetection guessed wrong.");
OnUnknownStreamFormat();
DrainQueue();
}
}
private void OnUnknownStreamFormat()
{
logger.WarnFormat("MIS {0} has an unknown stream type. The IP packet detection algorithm from older skyscraper8 versions will be used. For further analysis, please consider submitting a sample of this stream.", Context.GetMisId());
misHandler = new IPv4PacketBruteforce(Context);
} }
private bool AnalyzeCrc32Values() private bool AnalyzeCrc32Values()

View File

@ -2,7 +2,7 @@
"profiles": { "profiles": {
"skyscraper8": { "skyscraper8": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "\"C:\\Users\\Sascha Schiemann\\Downloads\\11476 H_GSE_(1)\\11476 V_GSE_.ts\"", "commandLineArgs": "\"F:\\utena\\0008W_Thor\\recap-max-sx8\\skyscraper_20251029_2110_0008W_10841_V_24497.ts\"",
"remoteDebugEnabled": false "remoteDebugEnabled": false
}, },
"Container (Dockerfile)": { "Container (Dockerfile)": {