[Home]

Summary:ASTERISK-12013: Giving remote command halts if asterisk process stops
Reporter:Konstantinos Arvanitis (karvanitis)Labels:
Date Opened:2008-05-13 10:33:56Date Closed:2008-05-13 13:33:12
Priority:MinorRegression?No
Status:Closed/CompleteComponents:General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
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;
                       }


****** ADDITIONAL INFORMATION ******

The fix is trivial and thus does not require a copyright release.
Comments:By: Digium Subversion (svnbot) 2008-05-13 13:30:20

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 ASTERISK-12013)

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

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

By: Digium Subversion (svnbot) 2008-05-13 13:32:22

Repository: asterisk
Revision: 115886

_U  trunk/
U   trunk/main/asterisk.c

------------------------------------------------------------------------
r115886 | tilghman | 2008-05-13 13:32:20 -0500 (Tue, 13 May 2008) | 11 lines

Merged revisions 115884 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

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

If the socket dies (read returns 0=EOF), return immediately.
(Closes issue ASTERISK-12013)

........

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

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

By: Digium Subversion (svnbot) 2008-05-13 13:33:12

Repository: asterisk
Revision: 115887

_U  branches/1.6.0/
U   branches/1.6.0/main/asterisk.c

------------------------------------------------------------------------
r115887 | tilghman | 2008-05-13 13:33:10 -0500 (Tue, 13 May 2008) | 19 lines

Merged revisions 115886 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r115886 | tilghman | 2008-05-13 13:38:11 -0500 (Tue, 13 May 2008) | 11 lines

Merged revisions 115884 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

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

If the socket dies (read returns 0=EOF), return immediately.
(Closes issue ASTERISK-12013)

........

................

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

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