Skip to content

Commit

Permalink
mDNS, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed Aug 8, 2024
1 parent 95da887 commit c546a05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Protest/Protocols/Mdns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public static byte[] Resolve(string queryString, int timeout = 2000, RecordType
byte[] reply = new byte[1024];

try {
//EndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0);
//int length = socket.ReceiveFrom(reply, ref remoteEP);

int length = socket.Receive(reply);
if (length > 0) {
byte[] actualReply = new byte[length];
Expand Down Expand Up @@ -246,7 +249,7 @@ private static Answer[] DeconstructResponse(
Answer ans = new Answer();

int nameStartIndex = index;

if ((response[index] & 0xC0) == 0xC0) {
index += 2;
}
Expand Down Expand Up @@ -277,7 +280,7 @@ private static Answer[] DeconstructResponse(
index += 2; //skip preference
}

if (ans.length > response.Length - index ) {
if (ans.length > response.Length - index) {
ans.error = 254;
break;
}
Expand Down

0 comments on commit c546a05

Please sign in to comment.