aboutsummaryrefslogtreecommitdiff
path: root/src/connections.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-09-13 02:20:28 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-09-13 02:20:28 -0300
commit748f676ea6474053e592f47804da27d4b9e49041 (patch)
treeaad574d96a87ca24f1228b4191030dad66e9dcdc /src/connections.cc
parent5e980ee99afd161d6258e5ea68f7284f715e5577 (diff)
downloadquerymanager-748f676ea6474053e592f47804da27d4b9e49041.tar.gz
querymanager-748f676ea6474053e592f47804da27d4b9e49041.zip
remove ParseOptionalIPAddress
I had just added it in the last commit but it made its use case non-obvious. Checking whether the string is empty before trying to parse an IP address is clearer than calling some function that has its own concept of what an empty address is.
Diffstat (limited to 'src/connections.cc')
-rw-r--r--src/connections.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/connections.cc b/src/connections.cc
index d032ce5..480cc1e 100644
--- a/src/connections.cc
+++ b/src/connections.cc
@@ -918,7 +918,7 @@ void ProcessSetNamelockQuery(TConnection *Connection, TReadBuffer *Buffer){
Buffer->ReadString(Comment, sizeof(Comment));
int IPAddress = 0;
- if(!ParseOptionalIPAddress(IPString, &IPAddress)){
+ if(!StringEmpty(IPString) && !ParseIPAddress(IPString, &IPAddress)){
SendQueryStatusFailed(Connection);
return;
}
@@ -978,7 +978,7 @@ void ProcessBanishAccountQuery(TConnection *Connection, TReadBuffer *Buffer){
bool FinalWarning = Buffer->ReadFlag();
int IPAddress = 0;
- if(!ParseOptionalIPAddress(IPString, &IPAddress)){
+ if(!StringEmpty(IPString) && !ParseIPAddress(IPString, &IPAddress)){
SendQueryStatusFailed(Connection);
return;
}
@@ -1045,7 +1045,7 @@ void ProcessSetNotationQuery(TConnection *Connection, TReadBuffer *Buffer){
Buffer->ReadString(Comment, sizeof(Comment));
int IPAddress = 0;
- if(!ParseOptionalIPAddress(IPString, &IPAddress)){
+ if(!StringEmpty(IPString) && !ParseIPAddress(IPString, &IPAddress)){
SendQueryStatusFailed(Connection);
return;
}