Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv7993/channels

Modified Files:
        chan_agent.c chan_iax2.c chan_sip.c chan_zap.c 
Log Message:
Remove possibility of manager deadlocks from manager actions


Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -d -r1.154 -r1.155
--- chan_agent.c        26 Sep 2005 02:04:07 -0000      1.154
+++ chan_agent.c        28 Sep 2005 23:10:13 -0000      1.155
@@ -1381,7 +1381,6 @@
        astman_send_ack(s, m, "Agents will follow");
        ast_mutex_lock(&agentlock);
        p = agents;
-       ast_mutex_lock(&s->lock);
        while(p) {
                ast_mutex_lock(&p->lock);
 
@@ -1440,8 +1439,6 @@
        ast_cli(s->fd, "Event: AgentsComplete\r\n"
                "%s"
                "\r\n",idText);
-       ast_mutex_unlock(&s->lock);
-
        return 0;
 }
 

Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.350
retrieving revision 1.351
diff -u -d -r1.350 -r1.351
--- chan_iax2.c 25 Sep 2005 19:13:54 -0000      1.350
+++ chan_iax2.c 28 Sep 2005 23:10:13 -0000      1.351
@@ -4239,10 +4239,8 @@
 {
        char *a[] = { "iax2", "show", "users" };
        int ret;
-       ast_mutex_lock(&s->lock);
        ret = iax2_show_peers( s->fd, 3, a );
        ast_cli( s->fd, "\r\n\r\n" );
-       ast_mutex_unlock(&s->lock);
        return ret;
 } /* /JDG */
 

Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.869
retrieving revision 1.870
diff -u -d -r1.869 -r1.870
--- chan_sip.c  28 Sep 2005 04:08:57 -0000      1.869
+++ chan_sip.c  28 Sep 2005 23:10:13 -0000      1.870
@@ -4502,8 +4502,8 @@
 static void build_rpid(struct sip_pvt *p)
 {
        int send_pres_tags = 1;
-       const char *privacy;
-       const char *screen;
+       const char *privacy=NULL;
+       const char *screen=NULL;
        char buf[256];
        const char *clid = default_callerid;
        const char *clin = NULL;
@@ -7267,13 +7267,11 @@
        /* List the peers in separate manager events */
        _sip_show_peers(s->fd, &total, s, m, 3, a);
        /* Send final confirmation */
-       ast_mutex_lock(&s->lock);
        ast_cli(s->fd,
        "Event: PeerlistComplete\r\n"
        "ListItems: %d\r\n"
        "%s"
        "\r\n", total, idtext);
-       ast_mutex_unlock(&s->lock);
        return 0;
 }
 
@@ -7376,7 +7374,6 @@
                        ntohs(iterator->addr.sin_port), status);
                } else {        /* Manager format */
                        /* The names here need to be the same as other channels 
*/
-                       ast_mutex_lock(&s->lock);
                        ast_cli(fd, 
                        "Event: PeerEntry\r\n%s"
                        "Channeltype: SIP\r\n"
@@ -7396,8 +7393,6 @@
                        (ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? 
"yes" : "no",      /* NAT=yes? */
                        iterator->ha ? "yes" : "no",       /* permit/deny */
                        status);
-               
-                       ast_mutex_unlock(&s->lock);
                }
 
                ASTOBJ_UNLOCK(iterator);
@@ -7691,7 +7686,6 @@
                astman_send_error(s, m, "Peer: <name> missing.\n");
                return 0;
        }
-       ast_mutex_lock(&s->lock);
        a[0] = "sip";
        a[1] = "show";
        a[2] = "peer";
@@ -7701,7 +7695,6 @@
                ast_cli(s->fd, "ActionID: %s\r\n",id);
        ret = _sip_show_peer(1, s->fd, s, m, 4, a );
        ast_cli( s->fd, "\r\n\r\n" );
-       ast_mutex_unlock(&s->lock);
        return ret;
 }
 

Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.526
retrieving revision 1.527
diff -u -d -r1.526 -r1.527
--- chan_zap.c  28 Sep 2005 21:29:40 -0000      1.526
+++ chan_zap.c  28 Sep 2005 23:10:14 -0000      1.527
@@ -9862,7 +9862,6 @@
        while (tmp) {
                if (tmp->channel > 0) {
                        int alarm = get_alarms(tmp);
-                       ast_mutex_lock(&s->lock);               
                        ast_cli(s->fd,
                                "Event: ZapShowChannels\r\n"
                                "Channel: %d\r\n"
@@ -9875,7 +9874,6 @@
                                tmp->channel, sig2str(tmp->sig), tmp->context, 
                                tmp->dnd ? "Enabled" : "Disabled",
                                alarm2str(alarm), idText);
-                       ast_mutex_unlock(&s->lock);             
                } 
 
                tmp = tmp->next;
@@ -9883,13 +9881,11 @@
 
        ast_mutex_unlock(&iflock);
        
-       ast_mutex_lock(&s->lock);               
        ast_cli(s->fd, 
                "Event: ZapShowChannelsComplete\r\n"
                "%s"
                "\r\n", 
                idText);
-       ast_mutex_unlock(&s->lock);             
        return 0;
 }
 

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to