of the file, so it can be used from more places;
+ make the declaration of contenttype[] more robust;
+ remove the wrappers around __xml_translate(), since they were
used only in one place, and rename to xml_translate().
This allows for a bit of simplifications.
+ document the output produced by the above function.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
they do similar things.
Add a small form on top of the html output so request like
http://foo:8088/asterisk/manager will suggest you what to do.
Note: i suspect there is still a bug somewhere in the session matching
code, as sometimes you have to login twice in order for the following
commands to be recognised.
Apart from this, the cli now is basically usable from a web form!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
minor optimizations to avoid extra calls of strlen(),
and some variable localization.
One feature worth backporting is the move of ast_variables_destroy()
to a different place in handle_uri() to avoid leaking memory
in case a uri is not found.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r45441 | russell | 2006-10-17 22:41:36 -0400 (Tue, 17 Oct 2006) | 7 lines
Don't attempt to access private data members of the pthread_mutex_t object,
because this does not work on all linux systems. Instead, just access
the reentrancy field in the ast_mutex_info struct when DEBUG_THREADS is
enabled. If DEBUG_CHANNEL_LOCKS is enabled, the developer probably has
DEBUG_THREADS on as well.
(issue #8139, me)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r45408 | kpfleming | 2006-10-17 17:24:10 -0500 (Tue, 17 Oct 2006) | 3 lines
optimize the 'quick response' code a bit more... no more malloc() or memset() for each response
expand stringfields API a bit to allow reusing the stringfield pool on a structure when needed, and remove some unnecessary code when the structure was being freed
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
................
r45381 | file | 2006-10-17 16:38:15 -0400 (Tue, 17 Oct 2006) | 9 lines
Blocked revisions 45380 via svnmerge
........
r45380 | file | 2006-10-17 16:37:17 -0400 (Tue, 17 Oct 2006) | 2 lines
Don't create a "real" pvt structure for requests that shouldn't be able to create one. Instead use a temporary pvt and fill it with enough information so we can send a reply.
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r45378 | file | 2006-10-17 16:30:34 -0400 (Tue, 17 Oct 2006) | 2 lines
Don't create a "real" pvt structure for requests that shouldn't be able to create one. Instead use a temporary pvt and fill it with enough information so we can send a reply.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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
I *know* it is not required, but it makes navigation easier and will help
when splitting up this large source code file.
Thank you!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45209 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
On passing, small rearrangement of the code to reduce indentation.
There is a bit more cleanup planned for this file, so a merge to 1.4
will be done when it is all done.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r45125 | kpfleming | 2006-10-13 18:02:48 -0500 (Fri, 13 Oct 2006) | 7 lines
------------------------------------------------------------------------
r45119 | kpfleming | 2006-10-13 17:57:42 -0500 (Fri, 13 Oct 2006) | 2 lines
don't drop the entire permit/deny list when an attempt is made to add an invalid entry (BE-92)
------------------------------------------------------------------------
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45126 65c4cc65-6c06-0410-ace0-fbb531ad65f3