[asterisk-commits] jdixon: branch jdixon/chan_usbradio-1.4 r140298 - /team/jdixon/chan_usbradio-...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Aug 27 13:36:19 CDT 2008
Author: jdixon
Date: Wed Aug 27 13:36:18 2008
New Revision: 140298
URL: http://svn.digium.com/view/asterisk?view=rev&rev=140298
Log:
Cleaned up stuff in chan_echolink for long-term stability
Modified:
team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_echolink.c
Modified: team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_echolink.c
URL: http://svn.digium.com/view/asterisk/team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_echolink.c?view=diff&rev=140298&r1=140297&r2=140298
==============================================================================
--- team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_echolink.c (original)
+++ team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_echolink.c Wed Aug 27 13:36:18 2008
@@ -31,7 +31,7 @@
/*** MODULEINFO
***/
-/* Version 0.12, 08/26/2008
+/* Version 0.13, 08/27/2008
Echolink channel driver for Asterisk/app_rpt.
A lot more has to be added,
Here is what comes to mind first:
@@ -1612,6 +1612,7 @@
if (send(sock,str,strlen(str),0) < 0)
{
ast_log(LOG_ERROR,"Unable to send to directory server %s\n",hostname);
+ close(sock);
return -1;
}
str[strlen(str) - 1] = 0;
@@ -1619,6 +1620,7 @@
if (recv(sock,str,4,0) != 4)
{
ast_log(LOG_ERROR,"Error in directory download (header) on %s\n",hostname);
+ close(sock);
return -1;
}
dir_compressed = 1;
@@ -1638,6 +1640,7 @@
if (el_net_get_line(sock,str,sizeof(str) - 1,dir_compressed,&z) < 1)
{
ast_log(LOG_ERROR,"Error in directory download (header) on %s\n",hostname);
+ close(sock);
return -1;
}
if (!strncmp(str,"@@@",3))
@@ -1651,12 +1654,14 @@
else
{
ast_log(LOG_ERROR,"Error in header on %s\n",hostname);
+ close(sock);
return -1;
}
}
if (el_net_get_line(sock,str,sizeof(str) - 1,dir_compressed,&z) < 1)
{
ast_log(LOG_ERROR,"Error in directory download (header) on %s\n",hostname);
+ close(sock);
return -1;
}
if (dir_compressed)
@@ -1664,6 +1669,7 @@
if(sscanf(str,"%d:%s",&rep_lines,snapshot_id) < 2)
{
ast_log(LOG_ERROR,"Error in parsing header on %s\n",hostname);
+ close(sock);
return -1;
}
}
@@ -1672,6 +1678,7 @@
if(sscanf(str,"%d",&rep_lines) < 1)
{
ast_log(LOG_ERROR,"Error in parsing header on %s\n",hostname);
+ close(sock);
return -1;
}
}
@@ -1702,12 +1709,14 @@
{
ast_log(LOG_ERROR,"Error in directory download on %s\n",hostname);
el_zapem(db_loading);
+ close(sock);
return -1;
}
if (el_net_get_line(sock,str,sizeof(str) - 1,dir_compressed,&z) < 1)
{
ast_log(LOG_ERROR,"Error in directory download on %s\n",hostname);
el_zapem(db_loading);
+ close(sock);
return -1;
}
if (str[strlen(str) - 1] == '\n')
@@ -1717,6 +1726,7 @@
{
ast_log(LOG_ERROR,"Error in directory download on %s\n",hostname);
el_zapem(db_loading);
+ close(sock);
return -1;
}
if (str[strlen(str) - 1] == '\n')
@@ -1726,12 +1736,14 @@
if (ast_db_put(EL_DB_ROOT,dbstr,nodenum) != 0)
{
ast_log(LOG_ERROR,"Error in putting ipaddr record %s (nodenum %s)",ipaddr,nodenum);
+ close(sock);
return -1;
}
sprintf(dbstr,"%c/nodenum/%s",db_loading,nodenum);
if (ast_db_put(EL_DB_ROOT,dbstr,ipaddr))
{
ast_log(LOG_ERROR,"Error in putting nodenum record %s (ipaddr %s)",nodenum,ipaddr);
+ close(sock);
return -1;
}
sprintf(dbstr,"%c/call/%s",db_loading,call);
@@ -1739,6 +1751,7 @@
if (ast_db_put(EL_DB_ROOT,dbstr,dbstr1))
{
ast_log(LOG_ERROR,"Error in putting call record %s (ipaddr %s)",nodenum,ipaddr);
+ close(sock);
return -1;
}
n++;
@@ -1750,6 +1763,7 @@
if (ast_db_put(EL_DB_ROOT,"active",dbstr) != 0)
{
ast_log(LOG_ERROR,"Error in finalizing DB process on %s\n",hostname);
+ close(sock);
return -1;
}
close(sock);
More information about the asterisk-commits
mailing list