This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CVE-2020-8416 DoS fix and antispam system improvement. Official v0.2.0
- Loading branch information
kolya5544
committed
Jan 29, 2020
1 parent
171e8ff
commit 9965337
Showing
4 changed files
with
229 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace BearFTP | ||
{ | ||
class Active | ||
{ | ||
public string hostname = ""; | ||
public int connected = 0; | ||
|
||
public Active(string hostname, int connected) | ||
{ | ||
this.hostname = hostname; | ||
this.connected = connected; | ||
} | ||
|
||
public static bool CheckExists(string hostname, List<Active> list) | ||
{ | ||
foreach (Active act in list) | ||
{ | ||
if (act.hostname == hostname) | ||
{ | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
public static int GetConnections(string hostname, List<Active> list) | ||
{ | ||
foreach (Active act in list) | ||
{ | ||
if (act.hostname == hostname) | ||
{ | ||
return act.connected; | ||
} | ||
} | ||
return -1; | ||
} | ||
|
||
public static void SetConnections(string hostname, List<Active> list, int connections) | ||
{ | ||
foreach (Active act in list) | ||
{ | ||
if (act.hostname == hostname) | ||
{ | ||
act.connected = connections; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.