Normal responses are sequences of lines of the form "Name: value",
with \r\n as line terminators and an empty line as a response
terminator.
Generi CLI commands, however, do not have such a clean formatting,
and the existing code failed to generate valid XML for them.
Obviously we can only use heuristics here, and we do the following:
- accept either \r or \n as a line terminator, trimming trailing whitespace;
- if a line does not have a ":" in it, assume that from this point on
we have unformatted data, and use "Opaque-data:" as a name;
- if a line does have a ":" in it, the Name field is not always
a legal identifier, so replace non-alphanum characters with underscores;
All the above is to be refined as we improve the formatting of
responses from the CLI.
And, all the above ought to go as a comment in the code rather than
just in a commit message...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
invoked through the http interface.
It is not terribly efficient but better than no output at all.
Todo: use a configurable /tmp directory instead of a hardwired one.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
replace non-alphanum chars with underscore.
This is useful when building field names in xml formatting.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
+ let some commands (Challenge, Login) be processed even if
already authenticated, as it doesn't harm and prevents some
incorrect error messages
+ remove custom code for Logoff - the existing handler was ok.
Some indentation fixes may be necessary
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
+ remove the need for an snprintf in astman_get_header()
+ fix comment for manager list eventq
+ localize one variable and minor code simplifications.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Mark with XXX one place (during command execution) where
navigation should be protected with actionlock, but is not
because it would block requests for a long time.
To solve this properly we need to put reference counts in
the struct manager_action.
A suboptimal fix is to copy the record on a search and then
unlock the list while we work on the copy.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
simplifications. On passing, use a single exit point.
(once done with the cleanup i will merge the changes into 1.4,
if applicable)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r44378 | kpfleming | 2006-10-04 14:47:22 -0500 (Wed, 04 Oct 2006) | 4 lines
update thread creation code a bit
reduce standard thread stack size slightly to allow the pthreads library to allocate the stack+data and not overflow a power-of-2 allocation in the kernel and waste memory/address space
add a new stack size for 'background' threads (those that don't handle PBX calls) when LOW_MEMORY is defined
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Original patch by junky, modified by anthonyl, modified again by jcolp (with minor modifications by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
allocation and free on every call of the function for preparing the string
that will be appended. Then, use the ast_dynamic_str() code instead of the
open coded version that is appended to when waiting for it to be delivered.
- use for loops for list traversals
- convert the manager sessions list to use list macros
- use atomic operations for num_sessions and usecounts
- convert some defines to the equivalent enum
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
- restructured build tree and makefiles to eliminate recursion problems
- support for embedded modules
- support for static builds
- simpler cross-compilation support
- simpler module/loader interface (no exported symbols)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3