projects
/
ircu2.10.12-pk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added gnutls backend and moved backend code into new files
[ircu2.10.12-pk.git]
/
ircd
/
m_squit.c
diff --git
a/ircd/m_squit.c
b/ircd/m_squit.c
index b71d28e1b7d61aa2a7809d1caaa431880634b5b7..5913cf2eae253cddce07fa9b0a00abd8005e3a18 100644
(file)
--- a/
ircd/m_squit.c
+++ b/
ircd/m_squit.c
@@
-28,6
+28,7
@@
#include "hash.h"
#include "ircd.h"
#include "ircd_chattr.h"
#include "hash.h"
#include "ircd.h"
#include "ircd_chattr.h"
+#include "ircd_log.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "numeric.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "numeric.h"
@@
-38,7
+39,7
@@
#include "s_user.h"
#include "send.h"
#include "s_user.h"
#include "send.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-60,7
+61,7
@@
int ms_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
const char* server = parv[1];
struct Client *acptr;
{
const char* server = parv[1];
struct Client *acptr;
- time_t timestamp;
+ time_t timestamp
= 0
;
char *comment = 0;
if (parc < 2)
char *comment = 0;
if (parc < 2)
@@
-77,26
+78,24
@@
int ms_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
acptr = FindNServer(server);
if (!acptr) {
acptr = FindNServer(server);
if (!acptr) {
- protocol_violation(sptr, "Issued SQUIT for unknown server %s (ignored)",
- server);
Debug((DEBUG_NOTICE, "Ignoring SQUIT to an unknown server"));
return 0;
}
/* If they are squitting me, we reverse it */
Debug((DEBUG_NOTICE, "Ignoring SQUIT to an unknown server"));
return 0;
}
/* If they are squitting me, we reverse it */
- if (IsMe(acptr))
{
+ if (IsMe(acptr))
acptr = cptr; /* Bugfix by Prefect */
acptr = cptr; /* Bugfix by Prefect */
- }
-
- timestamp = atoi(parv[2]);
+
+ if (parc > 2)
+ timestamp = atoi(parv[2]);
+ else
+ protocol_violation(cptr, "SQUIT with no timestamp/reason");
/* If atoi(parv[2]) == 0 we must indeed squit !
* It will be our neighbour.
*/
/* If atoi(parv[2]) == 0 we must indeed squit !
* It will be our neighbour.
*/
- if ( timestamp != 0 && timestamp != cli_serv(acptr)->timestamp) {
- protocol_violation(sptr, "Issued SQUIT for %C with wrong timestamp %Tu "
- "(%Tu) (ignored)", acptr, timestamp,
- cli_serv(acptr)->timestamp);
+ if ( timestamp != 0 && timestamp != cli_serv(acptr)->timestamp)
+ {
Debug((DEBUG_NOTICE, "Ignoring SQUIT with the wrong timestamp"));
return 0;
}
Debug((DEBUG_NOTICE, "Ignoring SQUIT with the wrong timestamp"));
return 0;
}
@@
-129,7
+128,7
@@
int mo_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
server = parv[1];
/*
server = parv[1];
/*
- * The following allows wild cards in SQUIT. Only useful
l
+ * The following allows wild cards in SQUIT. Only useful
* when the command is issued by an oper.
*/
for (acptr = GlobalClientList; (acptr = next_client(acptr, server));
* when the command is issued by an oper.
*/
for (acptr = GlobalClientList; (acptr = next_client(acptr, server));
@@
-144,7
+143,7
@@
int mo_squit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
/*
* Look for a matching server that is closer,
/*
* Look for a matching server that is closer,
- * that way we won't accidently squit two close
+ * that way we won't accident
al
ly squit two close
* servers like davis.* and davis-r.* when typing
* /SQUIT davis*
*/
* servers like davis.* and davis-r.* when typing
* /SQUIT davis*
*/