[asterisk-bugs] [Asterisk 0012637]: Giving remote command halts if asterisk process stops

noreply at bugs.digium.com noreply at bugs.digium.com
Tue May 13 13:30:21 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12637 
====================================================================== 
Reported By:                karvan
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   12637
Category:                   General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           1.4.20 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             05-13-2008 10:33 CDT
Last Modified:              05-13-2008 13:30 CDT
====================================================================== 
Summary:                    Giving remote command halts if asterisk process
stops
Description: 
When giving a command through the remote interface (ie 'rasterisk -x' or
'asterisk -rx') the process will get stuck in a loop if the original
asterisk process stops.

This happens at least with 'stop now', 'restart' and 'reload'.

Simple apply the following patch to fix this:

--- asterisk-1.4/main/asterisk.c     2008-05-09 12:50:30.000000000 +0300
+++ asterisk-fixed/main/asterisk.c     2008-05-13 18:26:09.000000000
+0300
@@ -2307,7 +2307,7 @@
                        char buf[512] = "", *curline = buf, *nextline;
                        int not_written = 1;

-                       if (read(ast_consock, buf, sizeof(buf) - 1) < 0)
{
+                       if (read(ast_consock, buf, sizeof(buf) - 1) <= 0)
{
                                break;
                        }

====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 05-13-08 13:30  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 115884

U   branches/1.4/main/asterisk.c

------------------------------------------------------------------------
r115884 | tilghman | 2008-05-13 13:30:18 -0500 (Tue, 13 May 2008) | 3
lines

If the socket dies (read returns 0=EOF), return immediately.
(Closes issue http://bugs.digium.com/view.php?id=12637)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=115884 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
05-13-08 13:30  svnbot         Note Added: 0086798                          
======================================================================




More information about the asterisk-bugs mailing list