srvx-commits Mailing List for srvx IRC Services (Page 7)
Brought to you by:
entrope
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(80) |
Sep
(51) |
Oct
(94) |
Nov
(132) |
Dec
(85) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(163) |
Feb
(96) |
Mar
(70) |
Apr
(182) |
May
(173) |
Jun
(73) |
Jul
(101) |
Aug
(101) |
Sep
(71) |
Oct
(76) |
Nov
(58) |
Dec
(60) |
| 2003 |
Jan
(61) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(7) |
Jun
(22) |
Jul
(81) |
Aug
(41) |
Sep
(34) |
Oct
(41) |
Nov
(16) |
Dec
(28) |
| 2004 |
Jan
(7) |
Feb
|
Mar
(3) |
Apr
(15) |
May
(11) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2005 |
Jan
(13) |
Feb
(6) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2025 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Entrope <en...@us...> - 2003-12-02 19:50:26
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv29363/src
Modified Files:
proto-p10.c
Log Message:
fix redundant test for unbursted channels
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -r1.81 -r1.82
*** proto-p10.c 28 Oct 2003 04:56:28 -0000 1.81
--- proto-p10.c 2 Dec 2003 19:50:22 -0000 1.82
***************
*** 1008,1013 ****
in_timestamp = atoi(argv[2]);
! if (self->burst
! && (cNode = dict_find(unbursted_channels, argv[1], NULL))) {
cNode->timestamp = in_timestamp;
dict_remove(unbursted_channels, cNode->name);
--- 1008,1012 ----
in_timestamp = atoi(argv[2]);
! if ((cNode = dict_find(unbursted_channels, argv[1], NULL))) {
cNode->timestamp = in_timestamp;
dict_remove(unbursted_channels, cNode->name);
|
|
From: Entrope <en...@us...> - 2003-12-02 19:47:17
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv28655/src Modified Files: mod-memoserv.c Log Message: fix typo in list header Index: mod-memoserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod-memoserv.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** mod-memoserv.c 20 Oct 2003 16:44:25 -0000 1.8 --- mod-memoserv.c 2 Dec 2003 19:47:14 -0000 1.9 *************** *** 66,70 **** #define MSMSG_LIST_HEAD "$bID$b $bFrom$b $bTime Sent$b" #define MSMSG_LIST_FORMAT "%-2u %s %s" ! #define MSMSG_MEMO_HEAD "#%u From $b%s$b, recieved on %s:" #define MSMSG_MEMO_BODY "%s" #define MSMSG_NO_SUCH_MEMO "You have no memo with that ID." --- 66,70 ---- #define MSMSG_LIST_HEAD "$bID$b $bFrom$b $bTime Sent$b" #define MSMSG_LIST_FORMAT "%-2u %s %s" ! #define MSMSG_MEMO_HEAD "#%u From $b%s$b, received on %s:" #define MSMSG_MEMO_BODY "%s" #define MSMSG_NO_SUCH_MEMO "You have no memo with that ID." |
|
From: Adrian D. <sai...@us...> - 2003-12-02 04:14:33
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv8996
Modified Files:
chanserv.c
Log Message:
Fix lock-up when there is a nick change that matches a nick-based chanserv ban when the channel's banlist is full.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.394
retrieving revision 1.395
diff -C2 -r1.394 -r1.395
*** chanserv.c 21 Nov 2003 13:21:21 -0000 1.394
--- chanserv.c 1 Dec 2003 22:15:21 -0000 1.395
***************
*** 6386,6390 ****
sprintf(kick_reason, CSMSG_KICK_FORMAT, bData->reason, bData->owner);
KickChannelUser(user, channel, chanserv, kick_reason);
- ii--; /* make sure we don't skip a channel */
break; /* we don't need to check any more bans in the channel */
}
--- 6386,6389 ----
|
|
From: Entrope <en...@us...> - 2003-11-21 13:21:25
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv23502/src
Modified Files:
chanserv.c
Log Message:
mark an in-channel suspended user as last seen at their suspension
(closes #846352)
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.393
retrieving revision 1.394
diff -C2 -r1.393 -r1.394
*** chanserv.c 20 Nov 2003 13:45:15 -0000 1.393
--- chanserv.c 21 Nov 2003 13:21:21 -0000 1.394
***************
*** 5694,5697 ****
--- 5694,5702 ----
return 0;
}
+ if(target->present)
+ {
+ target->present = 0;
+ target->seen = now;
+ }
target->flags |= USER_SUSPENDED;
chanserv_notice(user, CSMSG_USER_SUSPENDED, hi->handle, channel->name);
|
|
From: Entrope <en...@us...> - 2003-11-21 13:20:16
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv23314/src
Modified Files:
chanserv.help
Log Message:
fix typo in "topic" help entry
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** chanserv.help 18 Oct 2003 15:52:21 -0000 1.54
--- chanserv.help 21 Nov 2003 13:20:12 -0000 1.55
***************
*** 437,441 ****
"$uSee Also:$u unsuspend, deluser");
"TOPIC" ("/msg $C TOPIC <#channel> [topic]",
! "Sets the current topic for the specified channel. If no topic is specified, thenset the current topic to the default topic.");
"TRIM" ("/msg $C TRIM <#channel> <target> <duration>",
"The trim command removes target objects inactive for more than a certain duration from a channel. The target must be a channel access level, \"users\", or \"bans\". The duration argument specifies the amount of time the target has been inactive for to be removed.",
--- 437,441 ----
"$uSee Also:$u unsuspend, deluser");
"TOPIC" ("/msg $C TOPIC <#channel> [topic]",
! "Sets the current topic for the specified channel. If no topic is specified, then set the current topic to the default topic.");
"TRIM" ("/msg $C TRIM <#channel> <target> <duration>",
"The trim command removes target objects inactive for more than a certain duration from a channel. The target must be a channel access level, \"users\", or \"bans\". The duration argument specifies the amount of time the target has been inactive for to be removed.",
|
|
From: Entrope <en...@us...> - 2003-11-20 13:45:55
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv10315/src
Modified Files:
chanserv.c
Log Message:
look up correct account name when handling a rename
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.392
retrieving revision 1.393
diff -C2 -r1.392 -r1.393
*** chanserv.c 5 Nov 2003 14:13:34 -0000 1.392
--- chanserv.c 20 Nov 2003 13:45:15 -0000 1.393
***************
*** 6389,6393 ****
static void handle_rename(struct handle_info *handle, const char *old_handle)
{
! struct do_not_register *dnr = dict_find(handle_dnrs, handle->handle, NULL);
if(dnr)
--- 6389,6393 ----
static void handle_rename(struct handle_info *handle, const char *old_handle)
{
! struct do_not_register *dnr = dict_find(handle_dnrs, old_handle, NULL);
if(dnr)
|
|
From: Entrope <en...@us...> - 2003-11-20 13:19:52
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv5721/src Modified Files: nickserv.h Log Message: update comment and function name for reg_handle_rename_func() Index: nickserv.h =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.h,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** nickserv.h 5 Oct 2003 03:12:36 -0000 1.48 --- nickserv.h 20 Nov 2003 13:19:09 -0000 1.49 *************** *** 128,133 **** void reg_auth_func(auth_func_t func); ! /* Called just before a handle is renamed. */ ! typedef void (*handle_rename_func_t)(struct handle_info *handle, const char *new_handle); void reg_handle_rename_func(handle_rename_func_t func); --- 128,133 ---- void reg_auth_func(auth_func_t func); ! /* Called just after a handle is renamed. */ ! typedef void (*handle_rename_func_t)(struct handle_info *handle, const char *old_handle); void reg_handle_rename_func(handle_rename_func_t func); |
|
From: Entrope <en...@us...> - 2003-11-15 04:09:21
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv18689/src
Modified Files:
modcmd.c
Log Message:
use proper indexing in *modcmd.command for aliases
Index: modcmd.c
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -r1.72 -r1.73
*** modcmd.c 19 Oct 2003 15:31:59 -0000 1.72
--- modcmd.c 15 Nov 2003 04:09:18 -0000 1.73
***************
*** 1038,1042 ****
return 0;
}
!
if (argc > arg) {
/* a more complicated alias; fix it up */
--- 1038,1043 ----
return 0;
}
!
! arg = collapse_cmdname(argv+2, argc-2, newname) + 2;
if (argc > arg) {
/* a more complicated alias; fix it up */
***************
*** 1050,1058 ****
return 0;
}
! newcmd->alias.used = newcmd->alias.size = argc-3;
newcmd->alias.list = calloc(newcmd->alias.size, sizeof(newcmd->alias.list[0]));
! for (nn=0; nn<newcmd->alias.used; ++nn) {
! newcmd->alias.list[nn] = strdup(argv[nn+3]);
! }
}
--- 1051,1058 ----
return 0;
}
! newcmd->alias.used = newcmd->alias.size = argc-arg;
newcmd->alias.list = calloc(newcmd->alias.size, sizeof(newcmd->alias.list[0]));
! for (nn=0; nn<newcmd->alias.used; ++nn)
! newcmd->alias.list[nn] = strdup(argv[nn+arg]);
}
|
|
From: Entrope <en...@us...> - 2003-11-15 04:01:33
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv17635/src
Modified Files:
mod-snoop.c
Log Message:
fix the mod-snoop loss of config data on rehash
show NICK change arguments in proper order
Index: mod-snoop.c
===================================================================
RCS file: /cvsroot/srvx/services/src/mod-snoop.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** mod-snoop.c 19 Aug 2003 22:56:59 -0000 1.18
--- mod-snoop.c 15 Nov 2003 04:00:55 -0000 1.19
***************
*** 53,64 ****
const char *snoop_module_deps[] = { NULL };
#define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS)
#define UPDATE_TIMESTAMP() strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&now))
static void
! snoop_nick_change(struct userNode *user, const char *new_nick) {
if (!snoop_cfg.enabled) return;
UPDATE_TIMESTAMP();
! SNOOP("$bNICK$b change %s -> %s", user->nick, new_nick);
}
--- 53,67 ----
const char *snoop_module_deps[] = { NULL };
+ static int finalized;
+ int snoop_finalize(void);
+
#define SNOOP(FORMAT, ARGS...) send_channel_message(snoop_cfg.channel, snoop_cfg.bot, "%s "FORMAT, timestamp , ## ARGS)
#define UPDATE_TIMESTAMP() strftime(timestamp, sizeof(timestamp), "[%H:%M:%S]", localtime(&now))
static void
! snoop_nick_change(struct userNode *user, const char *old_nick) {
if (!snoop_cfg.enabled) return;
UPDATE_TIMESTAMP();
! SNOOP("$bNICK$b change %s -> %s", old_nick, user->nick);
}
***************
*** 128,132 ****
char *str;
- memset(&snoop_cfg, 0, sizeof(snoop_cfg));
node = conf_get_data("modules/snoop", RECDB_OBJECT);
if (!node) return;
--- 131,134 ----
***************
*** 138,141 ****
--- 140,144 ----
snoop_cfg.show_bursts = str ? enabled_string(str) : 0;
snoop_cfg.enabled = 1;
+ if (finalized) snoop_finalize();
}
***************
*** 168,171 ****
--- 171,175 ----
char *str;
+ finalized = 1;
node = conf_get_data("modules/snoop", RECDB_OBJECT);
if (!node) return 0;
|
|
From: Entrope <en...@us...> - 2003-11-15 03:35:31
|
Update of /cvsroot/srvx/services
In directory sc8-pr-cvs1:/tmp/cvs-serv14692
Modified Files:
configure.in
Log Message:
update to be autoconf-2.58-happy
coincidentally get rid of the silly TIME_T_CAST
Index: configure.in
===================================================================
RCS file: /cvsroot/srvx/services/configure.in,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -r1.74 -r1.75
*** configure.in 20 Oct 2003 16:19:40 -0000 1.74
--- configure.in 15 Nov 2003 03:35:26 -0000 1.75
***************
*** 3,7 ****
dnl General initialization.
AC_REVISION([$Id$])
! AC_PREREQ(2.53)
AC_INIT(srvx, 1.2, srv...@li...)
CODENAME=dust
--- 3,7 ----
dnl General initialization.
AC_REVISION([$Id$])
! AC_PREREQ(2.57)
AC_INIT(srvx, 1.2, srv...@li...)
CODENAME=dust
***************
*** 85,101 ****
AC_FUNC_MMAP
! dnl Define a helper macro used below for a few things.
! define([CACHE_COMPILE],[
! AC_MSG_CHECKING(for [$1])
! AC_CACHE_VAL(ac_cv_[$1], [AC_TRY_COMPILE([$2], [$3], ac_cv_[$1]="yes", ac_cv_[$1]="no")])
! AC_MSG_RESULT($ac_cv_[$1])
! if test $ac_cv_[$1] = yes ; then
! AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z]), 1, [$4])
! fi])
!
! CACHE_COMPILE(sin_len, [
! #include <sys/types.h>
! #include <netinet/in.h>
! ], [struct sockaddr_in *sin; sin->sin_len = 0;], [Define if struct sockaddr_in contains a sin_len field])
dnl Can only check with -Werror, but the rest of configure doesn't like -Werror
--- 85,95 ----
AC_FUNC_MMAP
! AC_CACHE_CHECK([for sin_len], ac_cv_sin_len,
! [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
! #include <netinet/in.h>],[struct sockaddr_in *sin; sin->sin_len = 0;])],
! ac_cv_sin_len="yes", ac_cv_sin_len="no")])
! if test $ac_cv_sin_len = yes ; then
! AC_DEFINE(HAVE_SIN_LEN, 1, [Define if struct sockaddr_in contains a sin_len field])
! fi
dnl Can only check with -Werror, but the rest of configure doesn't like -Werror
***************
*** 107,128 ****
AC_CACHE_VAL(ac_cv_fmt_time_t, [
ac_cv_fmt_time_t=no
! AC_TRY_COMPILE([#include <sys/types.h>
! #include <stdio.h>], [
time_t test=0;
printf("%li", test);
! ], ac_cv_fmt_time_t="\"%li\"")
if test $ac_cv_fmt_time_t = no; then
! AC_TRY_COMPILE([#include <sys/types.h>
! #include <stdio.h>], [
time_t test=0;
printf("%i", test);
! ], ac_cv_fmt_time_t="\"%i\"")
fi
if test $ac_cv_fmt_time_t = no; then
! echo
! AC_MSG_ERROR([
! Cannot detect format string for time_t
! Please check sys/types.h for the typedef of time_t and submit to a developer
! ])
fi
])
--- 101,121 ----
AC_CACHE_VAL(ac_cv_fmt_time_t, [
ac_cv_fmt_time_t=no
! AC_COMPILE_IFELSE([#include <sys/types.h>
! #include <stdio.h>
! void myfunc(void) {
time_t test=0;
printf("%li", test);
! }], ac_cv_fmt_time_t="\"%li\"")
if test $ac_cv_fmt_time_t = no; then
! AC_COMPILE_IFELSE([#include <sys/types.h>
! #include <stdio.h>
! void myfunc(void) {
time_t test=0;
printf("%i", test);
! }], ac_cv_fmt_time_t="\"%i\"")
fi
if test $ac_cv_fmt_time_t = no; then
! AC_MSG_ERROR([Cannot detect format string for time_t
! Please check sys/types.h for the typedef of time_t and submit to a developer])
fi
])
***************
*** 130,191 ****
AC_MSG_RESULT($ac_cv_fmt_time_t)
- dnl And how to cast a pointer to a time_t
- AC_MSG_CHECKING(for proper time_t cast)
- AC_CACHE_VAL(ac_cv_time_t_cast, [
- ac_cv_time_t_cast=no
- AC_TRY_COMPILE([#include <time.h>
- ], [
- void *time=0;
- return (time_t)time;
- ], ac_cv_time_t_cast="(time_t)")
- if test $ac_cv_time_t_cast = no; then
- AC_TRY_COMPILE([#include <time.h>
- ], [
- void *time=0;
- return (long)time;
- ], ac_cv_time_t_cast="(long)")
- fi
- if test $ac_cv_time_t_cast = no; then
- AC_TRY_COMPILE([#include <time.h>
- ], [
- void *time=0;
- return (int)time;
- ], ac_cv_time_t_cast="(int)")
- fi
- if test $ac_cv_time_t_cast = no; then
- echo
- AC_MSG_ERROR([
- Cannot detect correct void* cast of time_t
- Please check time.h for the typedef of time_t and submit to a
- developer
- ])
- fi
- ])
- AC_DEFINE_UNQUOTED(TIME_T_CAST, $ac_cv_time_t_cast, [Define as a cast to time_t from a void*.])
- AC_MSG_RESULT($ac_cv_time_t_cast)
-
dnl How to copy one va_list to another?
! AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
! AC_TRY_LINK(
! [#include <stdarg.h>],
! [va_list ap1, ap2;
! va_copy(ap1, ap2);],
! [ac_cv_c_va_copy="yes"],
! [ac_cv_c_va_copy="no"]
! )
! )
if test "$ac_cv_c_va_copy" = "yes" ; then
AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
fi
! AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
! AC_TRY_LINK(
! [#include <stdarg.h>],
! [va_list ap1, ap2;
! __va_copy(ap1, ap2);],
! [ac_cv_c___va_copy="yes"],
! [ac_cv_c___va_copy="no"]
! )
! )
if test "$ac_cv_c___va_copy" = "yes" ; then
AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
--- 123,141 ----
AC_MSG_RESULT($ac_cv_fmt_time_t)
dnl How to copy one va_list to another?
! AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy, [AC_LINK_IFELSE(
! [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);])],
! [ac_cv_c_va_copy="yes"],
! [ac_cv_c_va_copy="no"]
! )])
if test "$ac_cv_c_va_copy" = "yes" ; then
AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
fi
! AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy, [AC_LINK_IFELSE(
! [AC_LANG_PROGRAM([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);])],
! [ac_cv_c___va_copy="yes"],
! [ac_cv_c___va_copy="no"]
! )])
if test "$ac_cv_c___va_copy" = "yes" ; then
AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
***************
*** 343,345 ****
AC_SUBST(RX_INCLUDES)
AC_SUBST(RX_LIBS)
! AC_OUTPUT(Makefile rx/Makefile src/Makefile)
--- 293,296 ----
AC_SUBST(RX_INCLUDES)
AC_SUBST(RX_LIBS)
! AC_CONFIG_FILES(Makefile rx/Makefile src/Makefile)
! AC_OUTPUT
|
|
From: Entrope <en...@us...> - 2003-11-15 03:35:31
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14692/src
Modified Files:
heap.c helpserv.c timeq.c
Log Message:
update to be autoconf-2.58-happy
coincidentally get rid of the silly TIME_T_CAST
Index: heap.c
===================================================================
RCS file: /cvsroot/srvx/services/src/heap.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** heap.c 1 Sep 2003 14:44:26 -0000 1.24
--- heap.c 15 Nov 2003 03:35:26 -0000 1.25
***************
*** 213,216 ****
int_comparator(const void *a, const void *b)
{
! return TIME_T_CAST(a)-TIME_T_CAST(b);
}
--- 213,216 ----
int_comparator(const void *a, const void *b)
{
! return (time_t)a-(time_t)b;
}
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -r1.85 -r1.86
*** helpserv.c 6 Nov 2003 14:41:37 -0000 1.85
--- helpserv.c 15 Nov 2003 03:35:26 -0000 1.86
***************
*** 931,935 ****
helpserv_page(PGSRC_STATUS, HSMSG_PAGE_NEW_REQUEST, req->id, user->nick, user->handle_info ? user->handle_info->handle : "not authed");
} else if (hs->intervals[INTERVAL_STALE_DELAY]
! && (req->updated < TIME_T_CAST(now - hs->intervals[INTERVAL_STALE_DELAY]))
&& (!hs->req_maxlen || req->text->used < hs->req_maxlen)) {
char buf[MAX_LINE_SIZE], updatestr[INTERVALLEN], timestr[MAX_LINE_SIZE];
--- 931,935 ----
helpserv_page(PGSRC_STATUS, HSMSG_PAGE_NEW_REQUEST, req->id, user->nick, user->handle_info ? user->handle_info->handle : "not authed");
} else if (hs->intervals[INTERVAL_STALE_DELAY]
! && (req->updated < (time_t)(now - hs->intervals[INTERVAL_STALE_DELAY]))
&& (!hs->req_maxlen || req->text->used < hs->req_maxlen)) {
char buf[MAX_LINE_SIZE], updatestr[INTERVALLEN], timestr[MAX_LINE_SIZE];
***************
*** 2200,2204 ****
for (unh = hs->unhandled; unh; unh = unh->next_unhandled) {
queuesize++;
! if ((now - unh->opened) >= TIME_T_CAST hs->intervals[INTERVAL_WHINE_DELAY]) {
helpserv_reqlist_append(&reqlist, unh);
}
--- 2200,2204 ----
for (unh = hs->unhandled; unh; unh = unh->next_unhandled) {
queuesize++;
! if ((now - unh->opened) >= (time_t)hs->intervals[INTERVAL_WHINE_DELAY]) {
helpserv_reqlist_append(&reqlist, unh);
}
***************
*** 2208,2212 ****
char strwhinedelay[INTERVALLEN];
! intervalString(strwhinedelay, TIME_T_CAST hs->intervals[INTERVAL_WHINE_DELAY]);
#if ANNOYING_ALERT_PAGES
tbl.length = reqlist.used + 1;
--- 2208,2212 ----
char strwhinedelay[INTERVALLEN];
! intervalString(strwhinedelay, (time_t)hs->intervals[INTERVAL_WHINE_DELAY]);
#if ANNOYING_ALERT_PAGES
tbl.length = reqlist.used + 1;
***************
*** 2313,2317 ****
}
! intervalString(stridledelay, TIME_T_CAST(hs->intervals[INTERVAL_IDLE_DELAY]));
helpserv_page(PGSRC_STATUS, HSMSG_PAGE_IDLE_HEADER, mode_list.used, hs->helpchan->name, stridledelay);
table_send(hs->helpserv, hs->page_targets[PGSRC_STATUS]->name, 0, page_type_funcs[hs->page_types[PGSRC_STATUS]], tbl);
--- 2313,2317 ----
}
! intervalString(stridledelay, (time_t)hs->intervals[INTERVAL_IDLE_DELAY]);
helpserv_page(PGSRC_STATUS, HSMSG_PAGE_IDLE_HEADER, mode_list.used, hs->helpchan->name, stridledelay);
table_send(hs->helpserv, hs->page_targets[PGSRC_STATUS]->name, 0, page_type_funcs[hs->page_types[PGSRC_STATUS]], tbl);
***************
*** 3144,3153 ****
request->opened = time(NULL);
} else {
! request->opened = TIME_T_CAST strtoul(str, NULL, 0);
}
str = database_get_data(rd->d.object, KEY_REQUEST_ASSIGNED, RECDB_QSTRING);
if (str)
! request->assigned = TIME_T_CAST strtoul(str, NULL, 0);
str = database_get_data(rd->d.object, KEY_REQUEST_HELPER, RECDB_QSTRING);
--- 3144,3153 ----
request->opened = time(NULL);
} else {
! request->opened = (time_t)strtoul(str, NULL, 0);
}
str = database_get_data(rd->d.object, KEY_REQUEST_ASSIGNED, RECDB_QSTRING);
if (str)
! request->assigned = (time_t)strtoul(str, NULL, 0);
str = database_get_data(rd->d.object, KEY_REQUEST_HELPER, RECDB_QSTRING);
***************
*** 3340,3344 ****
str = database_get_data(GET_RECORD_OBJECT(br), KEY_REGISTERED, RECDB_QSTRING);
if (str)
! hs->registered = TIME_T_CAST strtol(str, NULL, 0);
str = database_get_data(GET_RECORD_OBJECT(br), KEY_IDWRAP, RECDB_QSTRING);
if (str)
--- 3340,3344 ----
str = database_get_data(GET_RECORD_OBJECT(br), KEY_REGISTERED, RECDB_QSTRING);
if (str)
! hs->registered = (time_t)strtol(str, NULL, 0);
str = database_get_data(GET_RECORD_OBJECT(br), KEY_IDWRAP, RECDB_QSTRING);
if (str)
Index: timeq.c
===================================================================
RCS file: /cvsroot/srvx/services/src/timeq.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** timeq.c 7 Jul 2003 16:29:34 -0000 1.18
--- timeq.c 15 Nov 2003 03:35:26 -0000 1.19
***************
*** 49,53 ****
void *time;
heap_peek(timeq, &time, 0);
! return TIME_T_CAST(time);
}
--- 49,53 ----
void *time;
heap_peek(timeq, &time, 0);
! return (time_t)time;
}
***************
*** 60,64 ****
ent->func = func;
ent->data = data;
! w = (void*)TIME_T_CAST(when);
heap_insert(timeq, w, ent);
}
--- 60,64 ----
ent->func = func;
ent->data = data;
! w = (void*)when;
heap_insert(timeq, w, ent);
}
***************
*** 76,80 ****
struct timeq_entry *a = data;
struct timeq_extra *b = extra;
! if (((b->mask & TIMEQ_IGNORE_WHEN) || (TIME_T_CAST(key) == b->when))
&& ((b->mask & TIMEQ_IGNORE_FUNC) || (a->func == b->func))
&& ((b->mask & TIMEQ_IGNORE_DATA) || (a->data == b->data))) {
--- 76,80 ----
struct timeq_entry *a = data;
struct timeq_extra *b = extra;
! if (((b->mask & TIMEQ_IGNORE_WHEN) || ((time_t)key == b->when))
&& ((b->mask & TIMEQ_IGNORE_FUNC) || (a->func == b->func))
&& ((b->mask & TIMEQ_IGNORE_DATA) || (a->data == b->data))) {
***************
*** 110,114 ****
while (heap_size(timeq) > 0) {
heap_peek(timeq, &k, &d);
! if (TIME_T_CAST(k) > now) break;
ent = d;
heap_pop(timeq);
--- 110,115 ----
while (heap_size(timeq) > 0) {
heap_peek(timeq, &k, &d);
! if ((time_t)k > now)
! break;
ent = d;
heap_pop(timeq);
|
|
From: Adrian D. <sai...@us...> - 2003-11-08 20:11:58
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5124
Modified Files:
opserv.c
Log Message:
Greatly improve input error checking for addtrust
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.348
retrieving revision 1.349
diff -C2 -r1.348 -r1.349
*** opserv.c 28 Oct 2003 04:55:56 -0000 1.348
--- opserv.c 8 Nov 2003 20:11:49 -0000 1.349
***************
*** 142,146 ****
#define OSMSG_NOT_EXEMPT "$b%s$b is not on the exempt list."
#define OSMSG_ALREADY_TRUSTED "Host $b%s$b is already trusted (use $bdeltrust$b and then $baddtrust$b to adjust)."
! #define OSMSG_HOSTNAME_ONLY "Please only use the hostname, and no ident part."
#define OSMSG_ADDED_TRUSTED "Added trusted hosts to the trusted-hosts list."
#define OSMSG_REMOVED_TRUSTED "Removed trusted hosts from the trusted-hosts list."
--- 142,147 ----
#define OSMSG_NOT_EXEMPT "$b%s$b is not on the exempt list."
#define OSMSG_ALREADY_TRUSTED "Host $b%s$b is already trusted (use $bdeltrust$b and then $baddtrust$b to adjust)."
! #define OSMSG_BAD_IP "$b%s$b is not a valid IP address"
! #define OSMSG_BAD_NUMBER "$b%s$b is not a number"
#define OSMSG_ADDED_TRUSTED "Added trusted hosts to the trusted-hosts list."
#define OSMSG_REMOVED_TRUSTED "Removed trusted hosts from the trusted-hosts list."
***************
*** 2070,2085 ****
{
unsigned long interval;
! char *reason;
if (dict_find(opserv_trusted_hosts, argv[1], NULL)) {
return opserv_notice(user, OSMSG_ALREADY_TRUSTED, argv[1]);
}
! if (strchr(argv[1], '@')) {
! reply(OSMSG_HOSTNAME_ONLY);
return 0;
}
! reason = unsplit_string(argv+4, argc-4, NULL);
interval = ParseInterval(argv[3]);
! opserv_add_trusted_host(argv[1], strtoul(argv[2], NULL, 0), user->handle_info->handle, now, interval ? (now + interval) : 0, reason);
return opserv_notice(user, OSMSG_ADDED_TRUSTED);
}
--- 2071,2102 ----
{
unsigned long interval;
! char *reason, *tmp;
! struct in_addr tmpaddr;
! int count;
if (dict_find(opserv_trusted_hosts, argv[1], NULL)) {
return opserv_notice(user, OSMSG_ALREADY_TRUSTED, argv[1]);
}
!
! if (!inet_aton(argv[1], &tmpaddr)) {
! reply(OSMSG_BAD_IP, argv[1]);
return 0;
}
!
! count = strtoul(argv[2], &tmp, 10);
! if (*tmp != '\0') {
! reply(OSMSG_BAD_NUMBER, argv[2]);
! return 0;
! }
!
interval = ParseInterval(argv[3]);
! if (interval == 0 && strcmp(argv[3], "0")) {
! reply(MSG_INVALID_DURATION, argv[3]);
! return 0;
! }
!
! reason = unsplit_string(argv+4, argc-4, NULL);
!
! opserv_add_trusted_host(argv[1], count, user->handle_info->handle, now, interval ? (now + interval) : 0, reason);
return opserv_notice(user, OSMSG_ADDED_TRUSTED);
}
|
|
From: Entrope <en...@us...> - 2003-11-07 02:44:57
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv946/src
Modified Files:
nickserv.c
Log Message:
do not allow cookies to be used on suspended accounts
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.265
retrieving revision 1.266
diff -C2 -r1.265 -r1.266
*** nickserv.c 6 Nov 2003 19:17:09 -0000 1.265
--- nickserv.c 7 Nov 2003 02:44:54 -0000 1.266
***************
*** 1708,1711 ****
--- 1708,1716 ----
}
+ if (HANDLE_FLAGGED(hi, SUSPENDED)) {
+ reply(NSMSG_HANDLE_SUSPENDED);
+ return 0;
+ }
+
if (!hi->cookie) {
nickserv_notice(user, NSMSG_NO_COOKIE);
|
|
From: Adrian D. <sai...@us...> - 2003-11-06 19:17:18
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv17392
Modified Files:
nickserv.c
Log Message:
If maxlogins has been set above the hard max by somone with override, don't
remove that setting upon restart.
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.264
retrieving revision 1.265
diff -C2 -r1.264 -r1.265
*** nickserv.c 18 Oct 2003 15:52:21 -0000 1.264
--- nickserv.c 6 Nov 2003 19:17:09 -0000 1.265
***************
*** 3004,3009 ****
str = database_get_data(obj, KEY_MAXLOGINS, RECDB_QSTRING);
hi->maxlogins = str ? strtoul(str, NULL, 0) : 0;
- if (hi->maxlogins > nickserv_conf.hard_maxlogins)
- hi->maxlogins = nickserv_conf.hard_maxlogins;
str = database_get_data(obj, KEY_OPSERV_LEVEL, RECDB_QSTRING);
hi->opserv_level = str ? strtoul(str, NULL, 0) : 0;
--- 3004,3007 ----
|
|
From: Entrope <en...@us...> - 2003-11-06 14:41:42
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv22877/src
Modified Files:
helpserv.c
Log Message:
clarify HelpServ stats output for variable week-start
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -r1.84 -r1.85
*** helpserv.c 5 Nov 2003 13:52:23 -0000 1.84
--- helpserv.c 6 Nov 2003 14:41:37 -0000 1.85
***************
*** 1851,1871 ****
struct helpfile_table tbl;
int i;
! char weekstr[32]; /* "September 10" should be the longest, but with other locales, who knows */
! char intervalstr[32]; /* Should be at least 1 more than enough */
! char buf[12];
! struct tm *week_tm;
! if (!from_opserv) {
! hs_user = GetHSUser(hs, user->handle_info);
! } else {
! hs_user = NULL;
! }
if (argc > 1) {
! if (!from_opserv) {
! if (hs_user->level < HlManager) {
! helpserv_notice(user, HSMSG_NEED_MANAGER);
! return 0;
! }
}
--- 1851,1862 ----
struct helpfile_table tbl;
int i;
! char intervalstr[INTERVALLEN], buf[16];
! hs_user = from_opserv ? NULL :GetHSUser(hs, user->handle_info);
if (argc > 1) {
! if (!from_opserv && (hs_user->level < HlManager)) {
! helpserv_notice(user, HSMSG_NEED_MANAGER);
! return 0;
}
***************
*** 1893,1927 ****
tbl.contents = alloca(tbl.length * sizeof(*tbl.contents));
tbl.contents[0] = alloca(tbl.width * sizeof(**tbl.contents));
! tbl.contents[0][0] = "Week of";
tbl.contents[0][1] = "Recorded time";
- week_tm = localtime(&last_stats_update);
- week_tm->tm_mday -= week_tm->tm_wday; /* Ensure it'll start on Sunday */
for (i=0; i < 5; i++) {
unsigned int week_time = target->time_per_week[i];
tbl.contents[i+1] = alloca(tbl.width * sizeof(**tbl.contents));
- if (i == 4) {
- tbl.contents[i+1][0] = strdup("Total");
- } else {
- mktime(week_tm); /* To fix up other stuff after messing with tm_mday */
- if (!strftime(weekstr, 32, "%B %d", week_tm)) {
- tbl.contents[i+1][0] = strdup("(Error)");
- } else {
- tbl.contents[i+1][0] = strdup(weekstr);
- }
- }
if ((i == 0 || i == 4) && target->join_time)
week_time += now - target->join_time;
helpserv_interval(intervalstr, week_time);
tbl.contents[i+1][1] = strdup(intervalstr);
- week_tm->tm_mday -= 7;
}
helpserv_notice(user, HSMSG_STATS_TIME, hs->helpchan->name);
table_send((from_opserv ? opserv : hs->helpserv), user->nick, 0, NULL, tbl);
! for (i=1; i <= 5; i++) {
! free((char *)tbl.contents[i][0]);
free((char *)tbl.contents[i][1]);
- }
tbl.length = 5;
--- 1884,1908 ----
tbl.contents = alloca(tbl.length * sizeof(*tbl.contents));
tbl.contents[0] = alloca(tbl.width * sizeof(**tbl.contents));
! tbl.contents[0][0] = "";
tbl.contents[0][1] = "Recorded time";
for (i=0; i < 5; i++) {
unsigned int week_time = target->time_per_week[i];
tbl.contents[i+1] = alloca(tbl.width * sizeof(**tbl.contents));
if ((i == 0 || i == 4) && target->join_time)
week_time += now - target->join_time;
helpserv_interval(intervalstr, week_time);
tbl.contents[i+1][1] = strdup(intervalstr);
}
+ tbl.contents[1][0] = "This week";
+ tbl.contents[2][0] = "Last week";
+ tbl.contents[3][0] = "2 weeks ago";
+ tbl.contents[4][0] = "3 weeks ago";
+ tbl.contents[5][0] = "Total";
helpserv_notice(user, HSMSG_STATS_TIME, hs->helpchan->name);
table_send((from_opserv ? opserv : hs->helpserv), user->nick, 0, NULL, tbl);
! for (i=1; i <= 5; i++)
free((char *)tbl.contents[i][1]);
tbl.length = 5;
|
|
From: Entrope <en...@us...> - 2003-11-05 14:18:36
|
Update of /cvsroot/srvx/services/patches
In directory sc8-pr-cvs1:/tmp/cvs-serv19388/patches
Modified Files:
helpserv-pgsql.diff
Log Message:
allocate a new query.list for each SQL log, since it's passed off to the queue
Index: helpserv-pgsql.diff
===================================================================
RCS file: /cvsroot/srvx/services/patches/helpserv-pgsql.diff,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** helpserv-pgsql.diff 26 Oct 2003 14:01:39 -0000 1.2
--- helpserv-pgsql.diff 5 Nov 2003 14:18:27 -0000 1.3
***************
*** 5,9 ****
diff -u -r1.59 Makefile.am
--- src/Makefile.am 9 Sep 2003 01:56:55 -0000 1.59
! +++ src/Makefile.am 26 Oct 2003 13:15:45 -0000
@@ -9,7 +9,7 @@
./expnhelp < $(srcdir)/nickserv.help.m4 > $@
--- 5,9 ----
diff -u -r1.59 Makefile.am
--- src/Makefile.am 9 Sep 2003 01:56:55 -0000 1.59
! +++ src/Makefile.am 5 Nov 2003 14:15:46 -0000
@@ -9,7 +9,7 @@
./expnhelp < $(srcdir)/nickserv.help.m4 > $@
***************
*** 18,25 ****
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
! retrieving revision 1.83
! diff -u -r1.83 helpserv.c
! --- src/helpserv.c 19 Oct 2003 04:16:10 -0000 1.83
! +++ src/helpserv.c 26 Oct 2003 13:15:47 -0000
@@ -46,6 +46,8 @@
#include "opserv.h"
--- 18,25 ----
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
! retrieving revision 1.84
! diff -u -r1.84 helpserv.c
! --- src/helpserv.c 5 Nov 2003 13:52:23 -0000 1.84
! +++ src/helpserv.c 5 Nov 2003 14:15:48 -0000
@@ -46,6 +46,8 @@
#include "opserv.h"
***************
*** 162,166 ****
+ dest->used += strftime(dest->list + dest->used, dest->size - dest->used, "'%Y-%m-%d %H:%M:%S', ", localtime_r(&when, &broken_out));
+}
! +
+static void
+pgsql_insert(char *query) {
--- 162,167 ----
+ dest->used += strftime(dest->list + dest->used, dest->size - dest->used, "'%Y-%m-%d %H:%M:%S', ", localtime_r(&when, &broken_out));
+}
!
! - fflush(reqlog_f);
+static void
+pgsql_insert(char *query) {
***************
*** 169,174 ****
+ pgsql_send_next_query();
+}
!
! - fflush(reqlog_f);
+static void helpserv_log_request(struct helpserv_request *req, const char *reason) {
+ char userhost[USERLEN+HOSTLEN+2];
--- 170,174 ----
+ pgsql_send_next_query();
+}
! +
+static void helpserv_log_request(struct helpserv_request *req, const char *reason) {
+ char userhost[USERLEN+HOSTLEN+2];
***************
*** 319,323 ****
saxdb_close_context(reqlog_ctx);
reqlog_ctx = NULL;
! @@ -4159,25 +4331,31 @@
return mktime(timeinfo);
}
--- 319,323 ----
saxdb_close_context(reqlog_ctx);
reqlog_ctx = NULL;
! @@ -4159,16 +4331,20 @@
return mktime(timeinfo);
}
***************
*** 329,335 ****
struct helpserv_bot *hs;
struct helpserv_user *hs_user;
! - int i;
dict_iterator_t it, it2;
- + int i;
+ char timestamp[64];
--- 329,334 ----
struct helpserv_bot *hs;
struct helpserv_user *hs_user;
! int i;
dict_iterator_t it, it2;
+ char timestamp[64];
***************
*** 338,357 ****
+ strftime(timestamp, sizeof(timestamp), "'%Y-%m-%d %H:%M:%S', ", &when_s);
+ query.size = 512;
! + query.list = malloc(query.size);
for (it=dict_first(helpserv_bots_dict); it; it=iter_next(it)) {
hs = iter_data(it);
! for (it2=dict_first(hs->users); it2; it2=iter_next(it2)) {
! hs_user = iter_data(it2);
!
! + /* Skip the helper if it's not their week-start day. */
! if (hs_user->week_start != when_s.tm_wday)
! continue;
!
! + /* Adjust their credit if they are in-channel at rollover. */
! if (hs_user->join_time) {
! hs_user->time_per_week[0] += when - hs_user->join_time;
! hs_user->time_per_week[4] += when - hs_user->join_time;
! @@ -4193,10 +4371,22 @@
hs_user->reassigned_to[i] = hs_user->reassigned_to[i-1];
}
--- 337,345 ----
+ strftime(timestamp, sizeof(timestamp), "'%Y-%m-%d %H:%M:%S', ", &when_s);
+ query.size = 512;
! +
for (it=dict_first(helpserv_bots_dict); it; it=iter_next(it)) {
hs = iter_data(it);
! @@ -4195,6 +4371,18 @@
hs_user->reassigned_to[i] = hs_user->reassigned_to[i-1];
}
***************
*** 359,362 ****
--- 347,351 ----
+ /* Log to SQL */
+ if (helpserv_conf.sql_log && hs->log_sql) {
+ + query.list = malloc(query.size);
+ query.used = 0;
+ string_buffer_append_string(&query, "INSERT INTO srvx_helpserv_stats (c_bot, t_weekstart, c_helper, i_time, i_picked_up, i_closed, i_reassigned_from, i_reassigned_to) VALUES(");
***************
*** 371,380 ****
hs_user->time_per_week[0] = hs_user->picked_up[0] = hs_user->closed[0] = hs_user->reassigned_from[0] = hs_user->reassigned_to[0] = 0;
}
! }
! + free(query.list);
! }
!
! static void helpserv_timed_run_stats(UNUSED_ARG(void *data)) {
! @@ -4226,6 +4416,10 @@
saxdb_close_context(reqlog_ctx);
if (reqlog_f)
--- 360,364 ----
hs_user->time_per_week[0] = hs_user->picked_up[0] = hs_user->closed[0] = hs_user->reassigned_from[0] = hs_user->reassigned_to[0] = 0;
}
! @@ -4228,6 +4416,10 @@
saxdb_close_context(reqlog_ctx);
if (reqlog_f)
***************
*** 387,391 ****
void init_helpserv() {
! @@ -4291,6 +4485,7 @@
helpserv_define_option("REQONJOIN", opt_req_on_join);
helpserv_define_option("AUTOVOICE", opt_auto_voice);
--- 371,375 ----
void init_helpserv() {
! @@ -4293,6 +4485,7 @@
helpserv_define_option("REQONJOIN", opt_req_on_join);
helpserv_define_option("AUTOVOICE", opt_auto_voice);
|
|
From: Entrope <en...@us...> - 2003-11-05 14:13:43
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv18299/src
Modified Files:
chanserv.c
Log Message:
compile fix for last commit (somebody changed my code while i was gone! honest!)
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.391
retrieving revision 1.392
diff -C2 -r1.391 -r1.392
*** chanserv.c 5 Nov 2003 13:51:38 -0000 1.391
--- chanserv.c 5 Nov 2003 14:13:34 -0000 1.392
***************
*** 6190,6194 ****
for(ban = channel->channel_info->bans; ban; ban = ban->next)
{
! unsigned char *argv[3];
char kick_reason[MAXLEN];
--- 6190,6194 ----
for(ban = channel->channel_info->bans; ban; ban = ban->next)
{
! const char *ban_mask = ban->mask;
char kick_reason[MAXLEN];
***************
*** 6196,6200 ****
continue;
sprintf(kick_reason, CSMSG_KICK_FORMAT, ban->reason, ban->owner);
! AddChannelBan(1, &ban->mask, channel, chanserv, now, 1);
KickChannelUser(user, channel, chanserv, kick_reason);
break;
--- 6196,6200 ----
continue;
sprintf(kick_reason, CSMSG_KICK_FORMAT, ban->reason, ban->owner);
! AddChannelBan(1, &ban_mask, channel, chanserv, now, 1);
KickChannelUser(user, channel, chanserv, kick_reason);
break;
|
|
From: Entrope <en...@us...> - 2003-11-05 13:52:33
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14561/src
Modified Files:
helpserv.c
Log Message:
add comments to helpserv_run_stats()
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -r1.83 -r1.84
*** helpserv.c 19 Oct 2003 04:16:10 -0000 1.83
--- helpserv.c 5 Nov 2003 13:52:23 -0000 1.84
***************
*** 4176,4182 ****
--- 4176,4184 ----
hs_user = iter_data(it2);
+ /* Skip the helper if it's not their week-start day. */
if (hs_user->week_start != when_s.tm_wday)
continue;
+ /* Adjust their credit if they are in-channel at rollover. */
if (hs_user->join_time) {
hs_user->time_per_week[0] += when - hs_user->join_time;
|
|
From: Entrope <en...@us...> - 2003-11-05 13:51:52
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14435/src
Modified Files:
chanserv.c
Log Message:
apply account-based bans when a user auths
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.390
retrieving revision 1.391
diff -C2 -r1.390 -r1.391
*** chanserv.c 28 Oct 2003 04:55:30 -0000 1.390
--- chanserv.c 5 Nov 2003 13:51:38 -0000 1.391
***************
*** 6131,6134 ****
--- 6131,6135 ----
{
struct userData *channel;
+ unsigned int ii, jj;
if(!user->handle_info)
***************
*** 6172,6175 ****
--- 6173,6203 ----
channel->seen = now;
channel->present = 1;
+ }
+
+ for(ii = 0; ii < user->channels.used; ++ii)
+ {
+ struct chanNode *channel = user->channels.list[ii]->channel;
+ struct banData *ban;
+
+ if((user->channels.list[ii]->modes & (MODE_CHANOP|MODE_VOICE))
+ || !channel->channel_info)
+ continue;
+ for(jj = 0; jj < channel->banlist.used; ++jj)
+ if(user_matches_glob(user, channel->banlist.list[jj]->ban, 1))
+ break;
+ if(jj < channel->banlist.used)
+ continue;
+ for(ban = channel->channel_info->bans; ban; ban = ban->next)
+ {
+ unsigned char *argv[3];
+ char kick_reason[MAXLEN];
+
+ if(!user_matches_glob(user, ban->mask, 1))
+ continue;
+ sprintf(kick_reason, CSMSG_KICK_FORMAT, ban->reason, ban->owner);
+ AddChannelBan(1, &ban->mask, channel, chanserv, now, 1);
+ KickChannelUser(user, channel, chanserv, kick_reason);
+ break;
+ }
}
|
|
From: Entrope <en...@us...> - 2003-10-28 05:20:58
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1676/src
Modified Files:
opserv.c
Log Message:
send a response to the user when ?unjupe succeeds
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.347
retrieving revision 1.348
diff -C2 -r1.347 -r1.348
*** opserv.c 20 Oct 2003 16:56:55 -0000 1.347
--- opserv.c 28 Oct 2003 04:55:56 -0000 1.348
***************
*** 227,230 ****
--- 227,231 ----
#define OSMSG_SERVER_JUPED "Added new jupe server %s."
#define OSMSG_SERVER_NOT_JUPE "That server is not a juped server."
+ #define OSMSG_SERVER_UNJUPED "Server jupe removed."
#define OSMSG_MODLOG_FAILED "Logging modification failed."
#define OSMSG_MODLOG_PASSED "Logging modification succeeded."
***************
*** 664,680 ****
srv = GetServerH(argv[1]);
! if (srv) {
! if (strncmp(srv->description, "JUPE", 4)) {
! opserv_notice(user, OSMSG_SERVER_NOT_JUPE);
! return 0;
! } else {
! reason = (argc > 2) ? unsplit_string(argv+2, argc-2, NULL) : "Unjuping server";
! DelServer(srv, 1, reason);
! return 1;
! }
! } else {
! opserv_notice(user, MSG_SERVER_UNKNOWN, argv[1]);
return 0;
}
}
--- 665,680 ----
srv = GetServerH(argv[1]);
! if (!srv) {
! reply(MSG_SERVER_UNKNOWN, argv[1]);
return 0;
}
+ if (strncmp(srv->description, "JUPE", 4)) {
+ reply(OSMSG_SERVER_NOT_JUPE);
+ return 0;
+ }
+ reason = (argc > 2) ? unsplit_string(argv+2, argc-2, NULL) : "Unjuping server";
+ DelServer(srv, 1, reason);
+ reply(OSMSG_SERVER_UNJUPED);
+ return 1;
}
|
|
From: Entrope <en...@us...> - 2003-10-28 05:02:43
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1772/src
Modified Files:
ioset.c ioset.h proto-p10.c
Log Message:
when we set the time, update 'now' instead of just 'clock_skew'
Index: ioset.c
===================================================================
RCS file: /cvsroot/srvx/services/src/ioset.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** ioset.c 26 Sep 2003 15:16:58 -0000 1.18
--- ioset.c 28 Oct 2003 04:56:28 -0000 1.19
***************
*** 42,46 ****
extern int uplink_connect(void);
! int clock_skew;
int do_write_dbs;
int do_reopen;
--- 42,46 ----
extern int uplink_connect(void);
! static int clock_skew;
int do_write_dbs;
int do_reopen;
***************
*** 436,438 ****
--- 436,444 ----
fd->send.put += nbw;
if (fd->send.put == fd->send.size) fd->send.put = 0;
+ }
+
+ void
+ ioset_set_time(unsigned long new_now) {
+ clock_skew = new_now - time(NULL);
+ now = new_now;
}
Index: ioset.h
===================================================================
RCS file: /cvsroot/srvx/services/src/ioset.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** ioset.h 7 Jul 2003 16:29:33 -0000 1.9
--- ioset.h 28 Oct 2003 04:56:28 -0000 1.10
***************
*** 56,59 ****
--- 56,60 ----
void ioset_close(int fd, int os_close);
void ioset_cleanup(void);
+ void ioset_set_time(unsigned long new_now);
#endif /* !defined(IOSET_H) */
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -r1.80 -r1.81
*** proto-p10.c 26 Oct 2003 14:02:34 -0000 1.80
--- proto-p10.c 28 Oct 2003 04:56:28 -0000 1.81
***************
*** 533,537 ****
irc_settime(const char *srv_name_mask, time_t new_time)
{
! clock_skew = new_time - time(NULL);
if (!strcmp(srv_name_mask, "*"))
srv_name_mask = "";
--- 533,537 ----
irc_settime(const char *srv_name_mask, time_t new_time)
{
! ioset_set_time(new_time);
if (!strcmp(srv_name_mask, "*"))
srv_name_mask = "";
***************
*** 788,808 ****
/* If we have a reliable clock, we just keep our current time. */
} else {
! if (srv->boot < self->boot) {
! /* The other server is older than us. Accept their timestamp. */
self->boot = srv->boot;
! clock_skew = srv->link - (now - clock_skew);
! } else if (srv->boot > self->boot) {
! /* We are older. Use our own timestamp. */
! } else {
! /* ircu dictates that the connected-to server's timestamp
! * is used if the boot times are the same. We will always
! * be connecting. */
! self->boot = srv->boot;
! clock_skew = srv->link - (now - clock_skew);
}
}
if (srv == self->uplink) {
extern time_t burst_begin;
! burst_begin = now + clock_skew;
}
return 1;
--- 788,802 ----
/* If we have a reliable clock, we just keep our current time. */
} else {
! if (srv->boot <= self->boot) {
! /* The other server is older than us. Accept their timestamp.
! * Alternately, we are same age, but we accept their time
! * since we are linking to them. */
self->boot = srv->boot;
! ioset_set_time(srv->link);
}
}
if (srv == self->uplink) {
extern time_t burst_begin;
! burst_begin = now;
}
return 1;
|
|
From: Entrope <en...@us...> - 2003-10-28 05:00:43
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1599/src
Modified Files:
chanserv.c
Log Message:
squelch signedness comparison warning with old gcc
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.389
retrieving revision 1.390
diff -C2 -r1.389 -r1.390
*** chanserv.c 26 Oct 2003 19:22:49 -0000 1.389
--- chanserv.c 28 Oct 2003 04:55:30 -0000 1.390
***************
*** 4583,4591 ****
{
char *msg;
- REQUIRE_PARAMS(channel ? 2 : 3);
if (channel) {
msg = unsplit_string(argv + 1, argc - 1, NULL);
send_channel_message(channel, cmd->parent->bot, "%s", msg);
} else if (GetUserH(argv[1])) {
msg = unsplit_string(argv + 2, argc - 2, NULL);
send_target_message(1, argv[1], cmd->parent->bot, "%s", msg);
--- 4583,4592 ----
{
char *msg;
if (channel) {
+ REQUIRE_PARAMS(2);
msg = unsplit_string(argv + 1, argc - 1, NULL);
send_channel_message(channel, cmd->parent->bot, "%s", msg);
} else if (GetUserH(argv[1])) {
+ REQUIRE_PARAMS(3);
msg = unsplit_string(argv + 2, argc - 2, NULL);
send_target_message(1, argv[1], cmd->parent->bot, "%s", msg);
|
|
From: Entrope <en...@us...> - 2003-10-26 19:24:35
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv21206/src
Modified Files:
chanserv.c
Log Message:
fix off-by-one error at end of user list in zoot_list
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.388
retrieving revision 1.389
diff -C2 -r1.388 -r1.389
*** chanserv.c 20 Oct 2003 17:17:40 -0000 1.388
--- chanserv.c 26 Oct 2003 19:22:49 -0000 1.389
***************
*** 3539,3543 ****
zoot_list(struct listData *list)
{
- enum userLevel lvl = list->highest;
struct userData *uData;
unsigned int start, curr;
--- 3539,3542 ----
***************
*** 3556,3569 ****
tmp_table.flags = list->table.flags;
list->table.contents[0][0] = " ";
! for(start = curr = 1; curr < list->table.length; ++curr)
{
uData = list->users[curr-1];
! list->table.contents[curr][0] = " ";
! if((start != curr) && ((uData->access != lvl) || (curr+1 == list->table.length)))
{
if(list->search)
! chanserv_notice(list->user, CSMSG_ACCESS_SEARCH_HDR, list->channel->name, accessNames[lvl], list->search);
else
! chanserv_notice(list->user, CSMSG_ACCESS_HEADER, list->channel->name, accessNames[lvl]);
temp = list->table.contents[--start];
list->table.contents[start] = list->table.contents[0];
--- 3555,3568 ----
tmp_table.flags = list->table.flags;
list->table.contents[0][0] = " ";
! for(start = curr = 1; curr < list->table.length; )
{
uData = list->users[curr-1];
! list->table.contents[curr++][0] = " ";
! if((curr == list->table.length) || (list->users[curr-1]->access != uData->access))
{
if(list->search)
! chanserv_notice(list->user, CSMSG_ACCESS_SEARCH_HDR, list->channel->name, accessNames[uData->access], list->search);
else
! chanserv_notice(list->user, CSMSG_ACCESS_HEADER, list->channel->name, accessNames[uData->access]);
temp = list->table.contents[--start];
list->table.contents[start] = list->table.contents[0];
***************
*** 3573,3577 ****
list->table.contents[start] = temp;
start = curr;
- lvl = uData->access;
}
}
--- 3572,3575 ----
|
|
From: Entrope <en...@us...> - 2003-10-26 14:06:31
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv29863/src
Modified Files:
proto-p10.c
Log Message:
fix off-by-one error in user modes reassembly
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -r1.79 -r1.80
*** proto-p10.c 5 Oct 2003 03:15:29 -0000 1.79
--- proto-p10.c 26 Oct 2003 14:02:34 -0000 1.80
***************
*** 959,963 ****
return 0;
serv = GetServerH(origin);
! if (argc > 10)
unsplit_string(argv+6, argc-9, modes);
else
--- 959,963 ----
return 0;
serv = GetServerH(origin);
! if (argc > 9)
unsplit_string(argv+6, argc-9, modes);
else
|
|
From: Entrope <en...@us...> - 2003-10-26 14:05:59
|
Update of /cvsroot/srvx/services/patches
In directory sc8-pr-cvs1:/tmp/cvs-serv29661/patches
Modified Files:
helpserv-pgsql.diff
Log Message:
Queue up HelpServ SQL commands, so that a vacuum doesn't hose it either
Index: helpserv-pgsql.diff
===================================================================
RCS file: /cvsroot/srvx/services/patches/helpserv-pgsql.diff,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** helpserv-pgsql.diff 19 Oct 2003 17:18:53 -0000 1.1
--- helpserv-pgsql.diff 26 Oct 2003 14:01:39 -0000 1.2
***************
*** 5,9 ****
diff -u -r1.59 Makefile.am
--- src/Makefile.am 9 Sep 2003 01:56:55 -0000 1.59
! +++ src/Makefile.am 19 Oct 2003 17:17:28 -0000
@@ -9,7 +9,7 @@
./expnhelp < $(srcdir)/nickserv.help.m4 > $@
--- 5,9 ----
diff -u -r1.59 Makefile.am
--- src/Makefile.am 9 Sep 2003 01:56:55 -0000 1.59
! +++ src/Makefile.am 26 Oct 2003 13:15:45 -0000
@@ -9,7 +9,7 @@
./expnhelp < $(srcdir)/nickserv.help.m4 > $@
***************
*** 21,34 ****
diff -u -r1.83 helpserv.c
--- src/helpserv.c 19 Oct 2003 04:16:10 -0000 1.83
! +++ src/helpserv.c 19 Oct 2003 17:17:30 -0000
! @@ -46,6 +46,7 @@
#include "opserv.h"
#include "saxdb.h"
#include "timeq.h"
+#include <postgresql/libpq-fe.h>
#define HELPSERV_CONF_NAME "services/helpserv"
#define HELPSERV_HELPFILE_NAME "helpserv.help"
! @@ -94,6 +95,7 @@
#define KEY_REQ_ON_JOIN "req_on_join"
#define KEY_AUTO_VOICE "auto_voice"
--- 21,35 ----
diff -u -r1.83 helpserv.c
--- src/helpserv.c 19 Oct 2003 04:16:10 -0000 1.83
! +++ src/helpserv.c 26 Oct 2003 13:15:47 -0000
! @@ -46,6 +46,8 @@
#include "opserv.h"
#include "saxdb.h"
#include "timeq.h"
+ +#include "ioset.h"
+#include <postgresql/libpq-fe.h>
#define HELPSERV_CONF_NAME "services/helpserv"
#define HELPSERV_HELPFILE_NAME "helpserv.help"
! @@ -94,6 +96,7 @@
#define KEY_REQ_ON_JOIN "req_on_join"
#define KEY_AUTO_VOICE "auto_voice"
***************
*** 38,42 ****
/* General */
#define HSMSG_WRITE_SUCCESS "HelpServ db write completed (in "FMT_TIME_T".%03lu seconds)."
! @@ -401,6 +403,7 @@
const char *description;
unsigned long db_backup_frequency;
--- 39,43 ----
/* General */
#define HSMSG_WRITE_SUCCESS "HelpServ db write completed (in "FMT_TIME_T".%03lu seconds)."
! @@ -401,6 +404,7 @@
const char *description;
unsigned long db_backup_frequency;
***************
*** 46,50 ****
static int helpserv_enabled;
! @@ -443,6 +446,7 @@
unsigned int req_on_join : 1;
unsigned int auto_voice : 1;
--- 47,51 ----
static int helpserv_enabled;
! @@ -443,6 +447,7 @@
unsigned int req_on_join : 1;
unsigned int auto_voice : 1;
***************
*** 54,58 ****
unsigned int helpchan_empty : 1;
! @@ -608,36 +612,106 @@
return dict_find(hs->users, hi->handle, NULL);
}
--- 55,59 ----
unsigned int helpchan_empty : 1;
! @@ -608,36 +613,153 @@
return dict_find(hs->users, hi->handle, NULL);
}
***************
*** 61,64 ****
--- 62,118 ----
- char key[27+NICKLEN];
- char userhost[USERLEN+HOSTLEN+2];
+ +static struct string_list sql_queue;
+ +static struct io_fd *sql_fd;
+
+ - if (!reqlog_ctx || !req)
+ +static void pgsql_send_next_query() {
+ + int res;
+ +
+ + res = PQsendQuery(helpserv_conf.sql_log, sql_queue.list[0]);
+ + if (!res) {
+ + log_module(MAIN_LOG, LOG_ERROR, "Error sending query \"%s\": %s", sql_queue.list[0], PQerrorMessage(helpserv_conf.sql_log));
+ return;
+ - if (!reason)
+ - reason = "";
+ + }
+ + res = PQflush(helpserv_conf.sql_log);
+ + if (res == EOF)
+ + log_module(MAIN_LOG, LOG_ERROR, "Error flushing PgSql output: %s", PQerrorMessage(helpserv_conf.sql_log));
+ +}
+ +
+ +static void pgsql_readable(UNUSED_ARG(struct io_fd *fd)) {
+ + PGconn *conn;
+ + PGresult *pgres;
+ + unsigned int ii;
+ + int res;
+ + ExecStatusType st;
+ +
+ + conn = helpserv_conf.sql_log;
+ + res = PQconsumeInput(conn);
+ + if (!res)
+ + log_module(MAIN_LOG, LOG_ERROR, "Error consuming PgSql input: %s", PQerrorMessage(conn));
+ + if (PQisBusy(conn))
+ + return;
+ + while ((pgres = PQgetResult(conn))) {
+ + st = PQresultStatus(pgres);
+ + if (st != PGRES_COMMAND_OK)
+ + log_module(MAIN_LOG, LOG_ERROR, "PgSql error in \"%s\": %s", sql_queue.list[0], PQresultErrorMessage(pgres));
+ + PQclear(pgres);
+ + }
+ + if (sql_queue.used == 1)
+ + sql_queue.list[1] = NULL;
+ + free(sql_queue.list[0]);
+ + sql_queue.used--;
+ + for (ii = 0; ii < sql_queue.used; ++ii)
+ + sql_queue.list[ii] = sql_queue.list[ii+1];
+ + if (sql_queue.used)
+ + pgsql_send_next_query();
+ +}
+
+ - sprintf(key, "%s-" FMT_TIME_T "-%lu", req->hs->helpserv->nick, req->opened, req->id);
+ - saxdb_start_record(reqlog_ctx, key, 1);
+ - if (req->helper) {
+ - saxdb_write_string(reqlog_ctx, KEY_REQUEST_HELPER, req->helper->handle->handle);
+ - saxdb_write_int(reqlog_ctx, KEY_REQUEST_ASSIGNED, req->assigned);
+static void
+string_buffer_append_quoted(struct string_buffer *dest, const char *src) {
***************
*** 77,84 ****
+ } else {
+ string_buffer_append_string(dest, "NULL, ");
! + }
+}
!
! - if (!reqlog_ctx || !req)
+static void
+string_buffer_append_time(struct string_buffer *dest, time_t when) {
--- 131,139 ----
+ } else {
+ string_buffer_append_string(dest, "NULL, ");
! }
! - if (req->handle) {
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_HANDLE, req->handle->handle);
+}
! +
+static void
+string_buffer_append_time(struct string_buffer *dest, time_t when) {
***************
*** 86,101 ****
+ if (!when) {
+ string_buffer_append_string(dest, "NULL, ");
! return;
! - if (!reason)
! - reason = "";
! -
! - sprintf(key, "%s-" FMT_TIME_T "-%lu", req->hs->helpserv->nick, req->opened, req->id);
! - saxdb_start_record(reqlog_ctx, key, 1);
! - if (req->helper) {
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_HELPER, req->helper->handle->handle);
! - saxdb_write_int(reqlog_ctx, KEY_REQUEST_ASSIGNED, req->assigned);
}
! - if (req->handle) {
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_HANDLE, req->handle->handle);
+ if (dest->size < dest->used + 20) {
+ if (dest->size < 20) {
--- 141,150 ----
+ if (!when) {
+ string_buffer_append_string(dest, "NULL, ");
! + return;
}
! - if (req->user) {
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_NICK, req->user->nick);
! - sprintf(userhost, "%s@%s", req->user->ident, req->user->hostname);
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_USERHOST, userhost);
+ if (dest->size < dest->used + 20) {
+ if (dest->size < 20) {
***************
*** 106,120 ****
+ dest->list = realloc(dest->list, dest->size);
}
! - if (req->user) {
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_NICK, req->user->nick);
+ dest->used += strftime(dest->list + dest->used, dest->size - dest->used, "'%Y-%m-%d %H:%M:%S', ", localtime_r(&when, &broken_out));
+}
+
+static void helpserv_log_request(struct helpserv_request *req, const char *reason) {
+ char userhost[USERLEN+HOSTLEN+2];
+
+ if (req->user)
! sprintf(userhost, "%s@%s", req->user->ident, req->user->hostname);
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_USERHOST, userhost);
+ else
+ userhost[0] = 0;
--- 155,179 ----
+ dest->list = realloc(dest->list, dest->size);
}
! - saxdb_write_int(reqlog_ctx, KEY_REQUEST_OPENED, req->opened);
! - saxdb_write_int(reqlog_ctx, KEY_REQUEST_CLOSED, now);
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_CLOSEREASON, reason);
! - saxdb_write_string_list(reqlog_ctx, KEY_REQUEST_TEXT, req->text);
! - saxdb_end_record(reqlog_ctx);
+ dest->used += strftime(dest->list + dest->used, dest->size - dest->used, "'%Y-%m-%d %H:%M:%S', ", localtime_r(&when, &broken_out));
+}
+
+ +static void
+ +pgsql_insert(char *query) {
+ + string_list_append(&sql_queue, query);
+ + if (sql_queue.used == 1)
+ + pgsql_send_next_query();
+ +}
+
+ - fflush(reqlog_f);
+static void helpserv_log_request(struct helpserv_request *req, const char *reason) {
+ char userhost[USERLEN+HOSTLEN+2];
+
+ if (req->user)
! + sprintf(userhost, "%s@%s", req->user->ident, req->user->hostname);
+ else
+ userhost[0] = 0;
***************
*** 143,147 ****
+ struct string_buffer query, sb;
+ unsigned int ii;
- + PGresult *res;
+
+ sb.used = query.used = 0;
--- 202,205 ----
***************
*** 168,189 ****
+ query.used -= 2; /* chop off ", " from append_quoted */
+ string_buffer_append_string(&query, ");");
! + res = PQexec(helpserv_conf.sql_log, query.list);
! + if (PQresultStatus(res) != PGRES_COMMAND_OK)
! + log_module(HS_LOG, LOG_ERROR, "Unable to SQL-store request %lu on bot %s: %s", req->id, req->hs->helpserv->nick, PQerrorMessage(helpserv_conf.sql_log));
! + PQclear(res);
! + free(query.list);
+ free(sb.list);
! }
! - saxdb_write_int(reqlog_ctx, KEY_REQUEST_OPENED, req->opened);
! - saxdb_write_int(reqlog_ctx, KEY_REQUEST_CLOSED, now);
! - saxdb_write_string(reqlog_ctx, KEY_REQUEST_CLOSEREASON, reason);
! - saxdb_write_string_list(reqlog_ctx, KEY_REQUEST_TEXT, req->text);
! - saxdb_end_record(reqlog_ctx);
! -
! - fflush(reqlog_f);
}
/* Searches for a request by number, nick, or account (num|nick|*account).
! @@ -2931,6 +3005,28 @@
OPTION_BINARY(hs->auto_devoice, "AutoDeVoice");
}
--- 226,236 ----
+ query.used -= 2; /* chop off ", " from append_quoted */
+ string_buffer_append_string(&query, ");");
! + pgsql_insert(query.list);
+ free(sb.list);
! + }
}
/* Searches for a request by number, nick, or account (num|nick|*account).
! @@ -2931,6 +3053,28 @@
OPTION_BINARY(hs->auto_devoice, "AutoDeVoice");
}
***************
*** 214,218 ****
helpserv_option_func_t *opt;
! @@ -2944,7 +3040,7 @@
opt_empty_interval, opt_stale_delay, opt_request_persistence,
opt_helper_persistence, opt_notification, opt_id_wrap,
--- 261,265 ----
helpserv_option_func_t *opt;
! @@ -2944,7 +3088,7 @@
opt_empty_interval, opt_stale_delay, opt_request_persistence,
opt_helper_persistence, opt_notification, opt_id_wrap,
***************
*** 223,227 ****
helpserv_notice(user, HSMSG_QUEUE_OPTIONS);
! @@ -3267,6 +3363,7 @@
saxdb_write_int(ctx, KEY_REQ_ON_JOIN, hs->req_on_join);
saxdb_write_int(ctx, KEY_AUTO_VOICE, hs->auto_voice);
--- 270,274 ----
helpserv_notice(user, HSMSG_QUEUE_OPTIONS);
! @@ -3267,6 +3411,7 @@
saxdb_write_int(ctx, KEY_REQ_ON_JOIN, hs->req_on_join);
saxdb_write_int(ctx, KEY_AUTO_VOICE, hs->auto_voice);
***************
*** 231,235 ****
/* End bot record */
saxdb_end_record(ctx);
! @@ -3376,6 +3473,8 @@
hs->auto_voice = str ? enabled_string(str) : 0;
str = database_get_data(GET_RECORD_OBJECT(br), KEY_AUTO_DEVOICE, RECDB_QSTRING);
--- 278,282 ----
/* End bot record */
saxdb_end_record(ctx);
! @@ -3376,6 +3521,8 @@
hs->auto_voice = str ? enabled_string(str) : 0;
str = database_get_data(GET_RECORD_OBJECT(br), KEY_AUTO_DEVOICE, RECDB_QSTRING);
***************
*** 240,244 ****
dict_foreach(users, user_read_helper, hs);
! @@ -3422,6 +3521,23 @@
helpserv_conf.reqlogfile = NULL;
}
--- 287,291 ----
dict_foreach(users, user_read_helper, hs);
! @@ -3422,6 +3569,31 @@
helpserv_conf.reqlogfile = NULL;
}
***************
*** 256,261 ****
--- 303,316 ----
+ log_module(HS_LOG, LOG_ERROR, "Pgsql connection failed: %s", PQerrorMessage(conn));
+ PQfinish(conn);
+ + } else if (PQsetnonblocking(conn, 1) == -1) {
+ + log_module(HS_LOG, LOG_ERROR, "Unable to make pgsql non-blocking");
+ + PQfinish(conn);
+ } else {
+ helpserv_conf.sql_log = conn;
+ + sql_fd = ioset_add(PQsocket(conn));
+ + sql_fd->connected = 1;
+ + sql_fd->wants_reads = 1;
+ + sql_fd->readable_cb = pgsql_readable;
+ + while (PQflush(conn)) ;
+ }
+ }
***************
*** 264,268 ****
saxdb_close_context(reqlog_ctx);
reqlog_ctx = NULL;
! @@ -4159,25 +4275,31 @@
return mktime(timeinfo);
}
--- 319,323 ----
saxdb_close_context(reqlog_ctx);
reqlog_ctx = NULL;
! @@ -4159,25 +4331,31 @@
return mktime(timeinfo);
}
***************
*** 298,302 ****
hs_user->time_per_week[0] += when - hs_user->join_time;
hs_user->time_per_week[4] += when - hs_user->join_time;
! @@ -4193,10 +4315,26 @@
hs_user->reassigned_to[i] = hs_user->reassigned_to[i-1];
}
--- 353,357 ----
hs_user->time_per_week[0] += when - hs_user->join_time;
hs_user->time_per_week[4] += when - hs_user->join_time;
! @@ -4193,10 +4371,22 @@
hs_user->reassigned_to[i] = hs_user->reassigned_to[i-1];
}
***************
*** 304,308 ****
+ /* Log to SQL */
+ if (helpserv_conf.sql_log && hs->log_sql) {
- + PGresult *res;
+ query.used = 0;
+ string_buffer_append_string(&query, "INSERT INTO srvx_helpserv_stats (c_bot, t_weekstart, c_helper, i_time, i_picked_up, i_closed, i_reassigned_from, i_reassigned_to) VALUES(");
--- 359,362 ----
***************
*** 311,318 ****
+ string_buffer_append_quoted(&query, hs_user->handle->handle);
+ string_buffer_append_printf(&query, "%d, %d, %d, %d, %d);", hs_user->time_per_week[0], hs_user->picked_up[0], hs_user->closed[0], hs_user->reassigned_from[0], hs_user->reassigned_to[0]);
! + res = PQexec(helpserv_conf.sql_log, query.list);
! + if (PQresultStatus(res) != PGRES_COMMAND_OK)
! + log_module(HS_LOG, LOG_ERROR, "Unable to SQL-store stats for helper %s on bot %s: %s", hs_user->handle->handle, hs->helpserv->nick, PQerrorMessage(helpserv_conf.sql_log));
! + PQclear(res);
+ }
+
--- 365,369 ----
+ string_buffer_append_quoted(&query, hs_user->handle->handle);
+ string_buffer_append_printf(&query, "%d, %d, %d, %d, %d);", hs_user->time_per_week[0], hs_user->picked_up[0], hs_user->closed[0], hs_user->reassigned_from[0], hs_user->reassigned_to[0]);
! + pgsql_insert(query.list);
+ }
+
***************
*** 325,329 ****
static void helpserv_timed_run_stats(UNUSED_ARG(void *data)) {
! @@ -4226,6 +4364,10 @@
saxdb_close_context(reqlog_ctx);
if (reqlog_f)
--- 376,380 ----
static void helpserv_timed_run_stats(UNUSED_ARG(void *data)) {
! @@ -4226,6 +4416,10 @@
saxdb_close_context(reqlog_ctx);
if (reqlog_f)
***************
*** 336,340 ****
void init_helpserv() {
! @@ -4291,6 +4433,7 @@
helpserv_define_option("REQONJOIN", opt_req_on_join);
helpserv_define_option("AUTOVOICE", opt_auto_voice);
--- 387,391 ----
void init_helpserv() {
! @@ -4291,6 +4485,7 @@
helpserv_define_option("REQONJOIN", opt_req_on_join);
helpserv_define_option("AUTOVOICE", opt_auto_voice);
|