Skip to content

Commit

Permalink
Ping utility, IPv6 bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
veniware committed Aug 14, 2024
1 parent 95c077f commit d2b9e3b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions Protest/Front/ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,10 @@ class Ping extends Console {
this.args.minimap = minimapCheckBox.checked;

if (!this.isClosed && this.ws != null && this.ws.readyState === 1) { //ready
this.ws.send(`timeout:${this.args.timeout}`);
this.ws.send(`interval:${this.args.interval}`);
this.ws.send(`method:${this.args.method}`);
this.ws.send(`rolling:${this.args.rolling}`);
this.ws.send(`timeout=${this.args.timeout}`);
this.ws.send(`interval=${this.args.interval}`);
this.ws.send(`method=${this.args.method}`);
this.ws.send(`rolling=${this.args.rolling}`);
}

if (minimapCheckBox.checked) {
Expand Down Expand Up @@ -732,7 +732,7 @@ class Ping extends Console {
this.count += 1;
}
else if (this.ws != null && this.ws.readyState === 1) { //ready
this.ws.send("add:" + this.count + ";" + host);
this.ws.send("add=" + this.count + ";" + host);
this.count += 1;
}
else {
Expand All @@ -755,7 +755,7 @@ class Ping extends Console {
this.request = this.request.replace(index + ";", "");

if (this.ws.readyState === 1) {
this.ws.send("remove:" + index);
this.ws.send("remove=" + index);
if (this.request.length === 0) this.ws.close();
}

Expand Down Expand Up @@ -792,25 +792,25 @@ class Ping extends Console {
let split = this.request.split(";");
let i = 0;

this.ws.send("timeout:" + this.args.timeout);
this.ws.send("interval:" + this.args.interval);
this.ws.send("method:" + this.args.method);
this.ws.send("rolling:" + this.args.rolling);
this.ws.send("timeout=" + this.args.timeout);
this.ws.send("interval=" + this.args.interval);
this.ws.send("method=" + this.args.method);
this.ws.send("rolling=" + this.args.rolling);

while (i < split.length) {
let req = "";
while (req.length < 768 && i < split.length) {
if (split[i].length > 0) req += split[i] + ";" + this.hashtable[split[i]].host + ";";
i++;
}
this.ws.send("add:" + req);
this.ws.send("add=" + req);
}

for (let i = 0; i < this.list.childNodes.length; i++) //remove warnings, if exist
if (this.list.childNodes[i].id === "self_destruct")
this.list.removeChild(this.list.childNodes[i]);

this.ws.send("ping:*");
this.ws.send("ping=*");

this.playButton.disabled = true;
this.pauseButton.disabled = false;
Expand Down Expand Up @@ -856,7 +856,7 @@ class Ping extends Console {

setTimeout(()=> {
if (this.request.length > 0 && !this.isClosed && this.ws != null && this.ws.readyState === 1) {
this.ws.send("ping:*");
this.ws.send("ping=*");
}
}, this.args.interval);
};
Expand Down
2 changes: 1 addition & 1 deletion Protest/Protocols/Icmp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static async void WebSocketHandler(HttpListenerContext ctx) {
break;
}

string[] msg = Encoding.Default.GetString(buff, 0, receiveResult.Count).Split(':');
string[] msg = Encoding.Default.GetString(buff, 0, receiveResult.Count).Split('=');
if (msg.Length < 2) continue;

switch (msg[0]) {
Expand Down

0 comments on commit d2b9e3b

Please sign in to comment.