[Asterisk-cvs] asterisk/cdr cdr_mysql.c,1.15,1.16
markster at lists.digium.com
markster at lists.digium.com
Mon Sep 8 11:46:58 CDT 2003
- Previous message: [Asterisk-cvs] asterisk/apps app_agi.c,1.11,1.12 app_mp3.c,1.4,1.5 app_queue.c,1.33,1.34 app_voicemail.c,1.13,1.14 app_voicemail2.c,1.46,1.47
- Next message: [Asterisk-cvs] asterisk/channels chan_agent.c,1.57,1.58 chan_iax2.c,1.47,1.48 chan_mgcp.c,1.18,1.19 chan_modem.c,1.5,1.6 chan_sip.c,1.172,1.173
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvsroot/asterisk/cdr
In directory mongoose.digium.com:/tmp/cvs-serv30979/cdr
Modified Files:
cdr_mysql.c
Log Message:
BSD portability enhancements (bug #234)
Index: cdr_mysql.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr/cdr_mysql.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** cdr_mysql.c 21 Aug 2003 16:01:25 -0000 1.15
--- cdr_mysql.c 8 Sep 2003 16:48:06 -0000 1.16
***************
*** 87,107 ****
if (connected) {
! char *clid=NULL, *dcontext=NULL, *channel=NULL, *dstchannel=NULL, *lastapp=NULL, *lastdata=NULL, *uniqueid=NULL;
/* Maximum space needed would be if all characters needed to be escaped, plus a trailing NULL */
! if (clid = alloca(strlen(cdr->clid) * 2 + 1))
mysql_real_escape_string(&mysql, clid, cdr->clid, strlen(cdr->clid));
! if (dcontext = alloca(strlen(cdr->dcontext) * 2 + 1))
mysql_real_escape_string(&mysql, dcontext, cdr->dcontext, strlen(cdr->dcontext));
! if (channel = alloca(strlen(cdr->channel) * 2 + 1))
mysql_real_escape_string(&mysql, channel, cdr->channel, strlen(cdr->channel));
! if (dstchannel = alloca(strlen(cdr->dstchannel) * 2 + 1))
mysql_real_escape_string(&mysql, dstchannel, cdr->dstchannel, strlen(cdr->dstchannel));
! if (lastapp = alloca(strlen(cdr->lastapp) * 2 + 1))
mysql_real_escape_string(&mysql, lastapp, cdr->lastapp, strlen(cdr->lastapp));
! if (lastdata = alloca(strlen(cdr->lastdata) * 2 + 1))
mysql_real_escape_string(&mysql, lastdata, cdr->lastdata, strlen(cdr->lastdata));
#ifdef MYSQL_LOGUNIQUEID
! if (uniqueid = alloca(strlen(cdr->uniqueid) * 2 + 1))
mysql_real_escape_string(&mysql, uniqueid, cdr->uniqueid, strlen(cdr->uniqueid));
#endif
--- 87,110 ----
if (connected) {
! char *clid=NULL, *dcontext=NULL, *channel=NULL, *dstchannel=NULL, *lastapp=NULL, *lastdata=NULL;
! #ifdef MYSQL_LOGUNIQUEID
! char *uniqueid=NULL;
! #endif
/* Maximum space needed would be if all characters needed to be escaped, plus a trailing NULL */
! if ((clid = alloca(strlen(cdr->clid) * 2 + 1)) != NULL)
mysql_real_escape_string(&mysql, clid, cdr->clid, strlen(cdr->clid));
! if ((dcontext = alloca(strlen(cdr->dcontext) * 2 + 1)) != NULL)
mysql_real_escape_string(&mysql, dcontext, cdr->dcontext, strlen(cdr->dcontext));
! if ((channel = alloca(strlen(cdr->channel) * 2 + 1)) != NULL)
mysql_real_escape_string(&mysql, channel, cdr->channel, strlen(cdr->channel));
! if ((dstchannel = alloca(strlen(cdr->dstchannel) * 2 + 1)) != NULL)
mysql_real_escape_string(&mysql, dstchannel, cdr->dstchannel, strlen(cdr->dstchannel));
! if ((lastapp = alloca(strlen(cdr->lastapp) * 2 + 1)) != NULL)
mysql_real_escape_string(&mysql, lastapp, cdr->lastapp, strlen(cdr->lastapp));
! if ((lastdata = alloca(strlen(cdr->lastdata) * 2 + 1)) != NULL)
mysql_real_escape_string(&mysql, lastdata, cdr->lastdata, strlen(cdr->lastdata));
#ifdef MYSQL_LOGUNIQUEID
! if ((uniqueid = alloca(strlen(cdr->uniqueid) * 2 + 1)) != NULL)
mysql_real_escape_string(&mysql, uniqueid, cdr->uniqueid, strlen(cdr->uniqueid));
#endif
***************
*** 142,146 ****
}
! int my_unload_module(void)
{
if (connected) {
--- 145,149 ----
}
! static int my_unload_module(void)
{
if (connected) {
***************
*** 178,182 ****
}
! int my_load_module(void)
{
int res;
--- 181,185 ----
}
! static int my_load_module(void)
{
int res;
- Previous message: [Asterisk-cvs] asterisk/apps app_agi.c,1.11,1.12 app_mp3.c,1.4,1.5 app_queue.c,1.33,1.34 app_voicemail.c,1.13,1.14 app_voicemail2.c,1.46,1.47
- Next message: [Asterisk-cvs] asterisk/channels chan_agent.c,1.57,1.58 chan_iax2.c,1.47,1.48 chan_mgcp.c,1.18,1.19 chan_modem.c,1.5,1.6 chan_sip.c,1.172,1.173
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the svn-commits
mailing list