[srvx-commits] CVS: services/src chanserv.c,1.382,1.383 proto-p10.c,1.78,1.79 sockcheck.c,1.92,1.93
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2003-10-05 03:15:39
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv21929/src
Modified Files:
chanserv.c proto-p10.c sockcheck.c
Log Message:
formatting tweaks/cleanup
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.382
retrieving revision 1.383
diff -C2 -r1.382 -r1.383
*** chanserv.c 3 Oct 2003 02:46:42 -0000 1.382
--- chanserv.c 5 Oct 2003 03:15:29 -0000 1.383
***************
*** 1245,1251 ****
if(access > USER_LEVEL_HIGHEST || access < USER_LEVEL_LOWEST)
- {
return NULL;
- }
ud = calloc(1, sizeof(*ud));
--- 1245,1249 ----
***************
*** 1259,1265 ****
ud->next = channel->users;
if(channel->users)
- {
channel->users->prev = ud;
- }
channel->users = ud;
--- 1257,1261 ----
***************
*** 1272,1278 ****
ud->u_next = ud->handle->channels;
if(ud->u_next)
- {
ud->u_next->u_prev = ud;
- }
ud->handle->channels = ud;
--- 1268,1272 ----
***************
*** 1285,1311 ****
del_channel_user(struct userData *user, int do_gc)
{
! struct chanData *channel;
! if(!user) return;
! user->channel->userCount[0]--;
! user->channel->userCount[user->access]--;
userCount[0]--;
userCount[user->access]--;
! if(user->prev) user->prev->next = user->next;
! else user->channel->users = user->next;
! if(user->next) user->next->prev = user->prev;
!
! if(user->u_prev) user->u_prev->u_next = user->u_next;
! else user->handle->channels = user->u_next;
! if(user->u_next) user->u_next->u_prev = user->u_prev;
! if(user->info) free(user->info);
! channel = user->channel;
free(user);
if(do_gc && !channel->users && !IsProtected(channel))
- {
unregister_channel(channel, "lost all users.");
- }
}
--- 1279,1307 ----
del_channel_user(struct userData *user, int do_gc)
{
! struct chanData *channel = user->channel;
! channel->userCount[0]--;
! channel->userCount[user->access]--;
userCount[0]--;
userCount[user->access]--;
! if(user->prev)
! user->prev->next = user->next;
! else
! channel->users = user->next;
! if(user->next)
! user->next->prev = user->prev;
!
! if(user->u_prev)
! user->u_prev->u_next = user->u_next;
! else
! user->handle->channels = user->u_next;
! if(user->u_next)
! user->u_next->u_prev = user->u_prev;
! free(user->info);
free(user);
if(do_gc && !channel->users && !IsProtected(channel))
unregister_channel(channel, "lost all users.");
}
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -r1.78 -r1.79
*** proto-p10.c 26 Sep 2003 15:31:50 -0000 1.78
--- proto-p10.c 5 Oct 2003 03:15:29 -0000 1.79
***************
*** 767,772 ****
} else {
/* this must be our uplink */
- if (argc < 8)
- return 0;
srv = self->uplink = AddServer(self, argv[1], atoi(argv[2]), atoi(argv[3]), atoi(argv[4]), argv[6], argv[argc-1]);
if (!srv)
--- 767,770 ----
***************
*** 1216,1227 ****
if (argc < 2)
return 0;
! if (argv[1][0] == ':')
! user = GetUserH(argv[1]+1);
! else
! user = GetUserN(argv[1]);
if (!user) {
! /* If we get a KILL for a non-local user, it could be a Ghost
! * response to a KILL we sent out earlier. So we only whine
! * if the target is local. */
if (!strncmp(argv[1], self->numeric, strlen(self->numeric)))
log_module(MAIN_LOG, LOG_ERROR, "Unable to find kill victim %s", argv[1]);
--- 1214,1223 ----
if (argc < 2)
return 0;
! user = GetUserN(argv[1]);
if (!user) {
! /* If we get a KILL for a non-existent user, it could be a
! * Ghost response to a KILL we sent out earlier. So we only
! * whine if the target is local.
! */
if (!strncmp(argv[1], self->numeric, strlen(self->numeric)))
log_module(MAIN_LOG, LOG_ERROR, "Unable to find kill victim %s", argv[1]);
Index: sockcheck.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sockcheck.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -r1.92 -r1.93
*** sockcheck.c 2 Aug 2003 23:13:23 -0000 1.92
--- sockcheck.c 5 Oct 2003 03:15:29 -0000 1.93
***************
*** 1088,1093 ****
sockcheck_new_user(struct userNode *user) {
/* If they have a bum IP, or are bursting in, don't proxy-check or G-line them. */
! if ((user->ip.s_addr == 0) || (ntohl(user->ip.s_addr) == INADDR_LOOPBACK) || user->uplink->burst) return 0;
! sockcheck_queue_address(user->ip);
return 0;
}
--- 1088,1095 ----
sockcheck_new_user(struct userNode *user) {
/* If they have a bum IP, or are bursting in, don't proxy-check or G-line them. */
! if (user->ip.s_addr
! && (ntohl(user->ip.s_addr) != INADDR_LOOPBACK)
! && !user->uplink->burst)
! sockcheck_queue_address(user->ip);
return 0;
}
|