done for exactly how much memory is needed. This was suggested by Luigi on
the asterisk-dev mailing list. Thanks!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48933 f38db490-d61c-443f-a65b-d21fe96a405b
this, implementing locking of this list to make it thread-safe.
- Add a "redirect" option to http.conf that allows redirecting one URI to
another. I was inspired to do this while playing with the Asterisk GUI. I
got tired of typing this URL to get to the GUI:
http://localhost:8088/asterisk/static/config/cfgadvanced.html
So, now I have the following line in http.conf:
redirect=/=/asterisk/static/config/cfgadvanced.html
Now, I can type the following into my browser and go to the GUI:
http://localhost:8088
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48930 f38db490-d61c-443f-a65b-d21fe96a405b
are passed as an argument.
- Update the code in main/http.c to use the new interface
(the diff is large but mostly mechanical, due to the name change of
several variables);
- And since now it is trivial, implement "AMI over TLS", and document
the possible options in manager.conf
- And since the test client (openssl s_client -connect host:port )
does not generate \r\n as a line terminator, make get_input()
also accept just a \n as a line terminator (Mac users: do you
also need the \r-only version ?)
The option parsing in manager.conf is not very efficient, and needs
to be cleaned up and made similar to what we have in http.conf
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48351 f38db490-d61c-443f-a65b-d21fe96a405b
and implement services over tcp and/or tcp-tls.
This commit is nothing more than moving structure definitions
(and documentation) from main/http.c to include/asterisk/http.h
(temporary location until we find a better place), and removing the
'static' qualifier from server_root() and server_start().
The name change (adding the ast_ prefix as a minimum, and then
possibly a more meaningful name) is postponed to future commits.
Does not apply to other versions of asterisk.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48324 f38db490-d61c-443f-a65b-d21fe96a405b
causing the http threads to do busy waiting around the socket...
Fix the mistake, sorry for the inconvenience!
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48074 f38db490-d61c-443f-a65b-d21fe96a405b
opening an SSL socket.
We are almost ready to make this code available to other modules.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48073 f38db490-d61c-443f-a65b-d21fe96a405b
Because https is more secure than http, it usually
makes sense to keep this service more open than the
one on the unencrypted port.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48071 f38db490-d61c-443f-a65b-d21fe96a405b
function doing work on the socket. This is another generalization
to provide a generic mechanism to open TCP/TLS socket with a thread
managing the accpet and children threads managing the individual
sessions.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48067 f38db490-d61c-443f-a65b-d21fe96a405b
and then run a service on it.
The code in manager.c does essentially the same things,
so we will be able to reuse the code in here (probably
moving it to netsock.c or another appropriate library file).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48008 f38db490-d61c-443f-a65b-d21fe96a405b
and support linux as well (using fopencookie(), which should
be available in glibc).
Update configure.ac to check for funopen (BSD) and fopencookie(glibc),
and while we are at it also for gethostbyname_r
(the generated files need to be updated, or you need
to run bootstrap.sh yourself).
Document the new options in http.conf.sample
(names are only tentative, better ones are welcome).
At this point we can safely enable the option.
Anyone willing to try this on Sun and Apple platforms ?
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45892 f38db490-d61c-443f-a65b-d21fe96a405b
The changes are not large. Most of the diff comes from putting the
global variables describing an accept session into a structure, so
we can reuse the existing code for running multiple accept threads
on different ports.
Once this is done, and if your system has the funopen() library
function (and ssl, of course), it is just a matter of calling
the appropriate functions to set up the ssl connection on the
existing socket, and everything works on the secure channel now.
At the moment, the code is disabled because i have not implemented yet
the autoconf code to detect the presence of funopen(), and add -lssl
to main/Makefile if ssl libraries are present. And a bit of documentation
on the http.conf arguments, too.
If you want to manually enable https support, that is very simple
(step 0 1 2 will be eventually detected by ./configure, the
rest is something you will have to do anyways).
0. make sure your system has funopen(3). FreeBSD does, linux probably
does too, not sure about other systems.
1. uncomment the following line in main/http.c
// #define DO_SSL /* comment in/out if you want to support ssl */
2. add -lssl to AST_LIBS in main/Makefile
3. add the following options to http.conf
sslenable=yes
sslbindport=4433 ; pick one you like
sslcert=/tmp/foo.pem ; path to your certificate file.
4. generate a suitable certificate e.g. (example from mini_httpd's Makefile:
openssl req -new -x509 -days 365 -nodes -out /tmp/foo.pem -keyout /tmp/foo.pem
and here you go:
https://localhost:4433/asterisk/manager
now works.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45869 f38db490-d61c-443f-a65b-d21fe96a405b
reply back to http clients.
Use fprintf/fwrite instead, since we are already using a FILE *
to read the input.
If you wonder why, this is because it makes it trivial to
implement https support (as long as your system has funopen()).
And this is what i am going to put in with the next few commits...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45858 f38db490-d61c-443f-a65b-d21fe96a405b
and reading from the config file used ntohs instead of htons.
this ought to be merged to 1.4 as well.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45836 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.digium.com/svn/asterisk/trunk@45463 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.digium.com/svn/asterisk/trunk@45152 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.digium.com/svn/asterisk/trunk@44379 f38db490-d61c-443f-a65b-d21fe96a405b
- 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: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b