Fix deletion of unopenable spool files.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 8 Oct 2012 21:24:11 +0000 (21:24 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 8 Oct 2012 21:24:11 +0000 (21:24 +0000)
commitab548bb0ce031a7c6a2415fd201c24c5ab56310b
treef6c713d843dad628cad18f2f581c068213559e53
parent3620fcff363e309577ecdb3ee7626f0754fe0511
Fix deletion of unopenable spool files.

If scan_service() cannot open the spool file, it logs a message saying
that it will delete the file and calls remove_from_queue() to do it.
However, remove_from_queue() fails to delete the spool file because struct
outgoing has not yet been fully initialized.

* Merged allocating a new struct outgoing and init_outgoing() into
new_outgoing().  Allocation is initialization.

* Made apply_outgoing() not initialize the spool filename in struct
outgoing.

* Made apply_outgoing() call ast_trim_blanks() and ast_skip_blanks()
rather than manually inlining them.

* Reduced indentation levels in apply_outgoing().

* Fixed a garbled comment in remove_from_queue().

* Reworked scan_service() to simplify it.

(closes issue ASTERISK-17231)
Reported by: David Chappell
Patches:
      spool_open_failure.diff (license #4997) patch uploaded by David Chappell
      Started with this patch.
........

Merged revisions 374686 from http://svn.asterisk.org/svn/asterisk/branches/1.8

* Fixed some memory leaks on off nominal paths in init_outgoing() when
merging into the new_outgoing() function dealing with o->capabilities.
........

Merged revisions 374695 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374708 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
pbx/pbx_spool.c