aboutsummaryrefslogtreecommitdiffstats
path: root/main/http.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-14Merged revisions 328247 via svnmerge from lmadsen1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@328259 f38db490-d61c-443f-a65b-d21fe96a405b
2011-05-05Merged revisions 316917-316919 via svnmerge from seanbright1-2/+10
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r316917 | seanbright | 2011-05-04 22:23:28 -0400 (Wed, 04 May 2011) | 5 lines Make sure that tcptls_session is properly initialized. (issue #18598) Reported by: ksn ........ r316918 | seanbright | 2011-05-04 22:25:20 -0400 (Wed, 04 May 2011) | 5 lines Look at the correct buffer for our digest info instead of an empty one. (issue #18598) Reported by: ksn ........ r316919 | seanbright | 2011-05-04 22:30:45 -0400 (Wed, 04 May 2011) | 10 lines Use the correct HTTP method when generating our digest, otherwise we always fail. When calculating the 'A2' portion of our digest for verification, we need the HTTP method that is currently in use. Unfortunately our mapping function was incorrect, resulting in invalid hashes being generated and, in turn, failures in authentication. (closes issue #18598) Reported by: ksn ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@316920 f38db490-d61c-443f-a65b-d21fe96a405b
2011-04-21Merged revisions 314628 via svnmerge from mnicholson1-3/+19
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r314628 | mnicholson | 2011-04-21 13:24:05 -0500 (Thu, 21 Apr 2011) | 27 lines Merged revisions 314620 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r314620 | mnicholson | 2011-04-21 13:22:19 -0500 (Thu, 21 Apr 2011) | 20 lines Merged revisions 314607 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r314607 | mnicholson | 2011-04-21 13:19:21 -0500 (Thu, 21 Apr 2011) | 14 lines Added limits to the number of unauthenticated sessions TCP based protocols are allowed to have open simultaneously. Also added timeouts for unauthenticated sessions where it made sense to do so. Unrelated, the manager interface now properly checks if the user has the "system" privilege before executing shell commands via the Originate action. AST-2011-005 AST-2011-006 (closes issue #18787) Reported by: kobaz (related to issue #18996) Reported by: tzafrir ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@314666 f38db490-d61c-443f-a65b-d21fe96a405b
2011-03-01Merged revisions 309204 via svnmerge from qwell1-7/+8
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r309204 | qwell | 2011-03-01 16:25:44 -0600 (Tue, 01 Mar 2011) | 7 lines Fix consistency of CRLFs on HTTP headers that get sent out. (closes issue #18186) Reported by: nivaldomjunior Patches: 18186-httpheadernewline.diff uploaded by qwell (license 4) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@309209 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-22Use ast_debug for console logginglathama1-5/+2
Guessed the log levels based on info that level 3 is the soft roof. Can we create a page / document to define the levels? git-svn-id: http://svn.digium.com/svn/asterisk/trunk@308527 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-21Add HTTP URI Debug logging and update noticelathama1-1/+4
enable reporting of the request URI / URL in debugging change funny debug note to a serious note. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@308372 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-19Add CSS MIME Typelathama1-0/+1
Modern browsers are checking for the MIME Type of pages and in some cases will not load a file if the type is wrong. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@308331 f38db490-d61c-443f-a65b-d21fe96a405b
2011-02-04Replace ast_log(LOG_DEBUG, ...) with ast_debug()pabelanger1-1/+1
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306258 f38db490-d61c-443f-a65b-d21fe96a405b
2011-01-31Asterisk HTTP response Content-typelathama1-0/+7
Address content type for BSD and other platforms (closes issue #18456) Reported by: alexo Patches: asterisk18_http.patch uploaded by alexo (license 1175) Tested by: alexo git-svn-id: http://svn.digium.com/svn/asterisk/trunk@305084 f38db490-d61c-443f-a65b-d21fe96a405b
2011-01-24According to section 19.1.2 of RFC 3261:mnicholson1-23/+5
For each component, the set of valid BNF expansions defines exactly which characters may appear unescaped. All other characters MUST be escaped. This patch modifies ast_uri_encode() to encode strings in line with this recommendation. This patch also adds an ast_escape_quoted() function which escapes '"' and '\' characters in quoted strings in accordance with section 25.1 of RFC 3261. The ast_uri_encode() function has also been modified to take an ast_flags struct describing the set of rules it should use when escaping characters to allow for it to escape SIP URIs in addition to HTTP URIs and other types of URIs or variations of those two URI types in the future. The ast_uri_decode() function has also been modified to accept an ast_flags struct describing the set of rules to use when decoding to enable decoding '+' as ' ' in legacy http URLs. The unit tests for these functions have also been updated. ABE-2705 Review: https://reviewboard.asterisk.org/r/1081/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@303509 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-29Enable IPv6 for the built-in HTTP server.mmichelson1-45/+60
Review: https://reviewboard.asterisk.org/r/986 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@293273 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-27Merged revisions 279726 via svnmerge from pabelanger1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r279726 | pabelanger | 2010-07-26 21:53:38 -0400 (Mon, 26 Jul 2010) | 9 lines Use ast_sockaddr_setnull() when http is not enabled. Otherwise, ast_tcptls_server_start() will still start http. (closes issue #17708) Reported by: pabelanger Patches: http.patch uploaded by pabelanger (license 224) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@279727 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-08Add IPv6 to Asterisk.mmichelson1-20/+35
This adds a generic API for accommodating IPv6 and IPv4 addresses within Asterisk. While many files have been updated to make use of the API, chan_sip and the RTP code are the files which actually support IPv6 addresses at the time of this commit. The way has been paved for easier upgrading for other files in the near future, though. Big thanks go to Simon Perrault, Marc Blanchet, and Jean-Philippe Dionne for their hard work on this. (closes issue #17565) Reported by: russell Patches: asteriskv6-test-report.pdf uploaded by russell (license 2) Review: https://reviewboard.asterisk.org/r/743 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@274783 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-15Don't continue sending the file when there has been an errortwilson1-0/+1
If there is a problem with a firmware file, Polycom phones will close the connection. We were continuing to send the file anyway. There should be no reason to continue sending a file if there is an error writing it. (closes issue #16682) Reported by: lmadsen git-svn-id: http://svn.digium.com/svn/asterisk/trunk@270692 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-23Don't act like an http write failed when it didn'ttwilson1-1/+1
fwrite returns the number of items written, not the number of bytes git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253958 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-02Adding external reference for doxygenoej1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226970 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-31Fix a trunk compilation warning.tilghman1-2/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215070 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10AST-2009-005tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15More 'static' qualifiers on module global variables.kpfleming1-1/+1
The 'pglobal' tool is quite handy indeed :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200620 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29Consistent SSL/TLS options across conf filesdvossel1-23/+8
ast_tls_read_conf() is a new api call for handling SSL/TLS options across all conf files. Before this change, SSL/TLS options were not consistent. http.conf and manager.conf required the 'ssl' prefix while sip.conf used options with the 'tls' prefix. While the options had different names in different conf files, they all did the exact same thing. Now, instead of mixing 'ssl' or 'tls' prefixes to do the same thing depending on what conf file you're in, all SSL/TLS options use the 'tls' prefix. For example. 'sslenable' in http.conf and manager.conf is now 'tlsenable' which matches what already existed in sip.conf. Since this has the potential to break backwards compatibility, previous options containing the 'ssl' prefix still work, but they are no longer documented in the sample.conf files. The change is noted in the CHANGES file though. Review: http://reviewboard.digium.com/r/237/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191028 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24TLS/SSL private key optiondvossel1-0/+9
Adds option to specify a private key .pem file when configuring TLS or SSL in AMI, HTTP, and SIP. Before this, the certificate file was used for both the public and private key. It is possible for this file to hold both, but most configurations allow for a separate private key file to be specified. Clarified in .conf files how these options are to be used. The current conf files do not explain how the private key is handled at all, so without knowledge of Asterisk's TLS implementation, it would be hard to know for sure what was going on or how to set it up. Review: http://reviewboard.digium.com/r/234/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190545 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-23Support HTTP digest authentication for the http manager interface.tilghman1-315/+442
(closes issue #10961) Reported by: ys Patches: digest_auth_r148468_v5.diff uploaded by ys (license 281) SVN branch http://svn.digium.com/svn/asterisk/team/group/manager_http_auth Tested by: ys, twilson, tilghman Review: http://reviewboard.digium.com/r/223/ Reviewed by: tilghman,russellb,mmichelson git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190349 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10Modify headers and macros, according to Russell's suggestions on the -dev listtilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187599 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-23Allow browsers to cache images and other static content.tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183865 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-17Fix qualify for TCP peertwilson1-8/+8
(closes issue #14192) Reported by: pabelanger Patches: asterisk-bug14192.diff.txt uploaded by jamesgolovich (license 176) Tested by: jamesgolovich git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169080 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13Merge ast_str_opaque branch (discontinue usage of ast_str internals)tilghman1-3/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05Janitor, use ARRAY_LEN() when possible.eliel1-1/+1
(closes issue #13990) Reported by: eliel Patches: array_len.diff uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@161218 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-02bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 ↵kpfleming1-3/+9
branch, and add the ones needed for all the new code here too git-svn-id: http://svn.digium.com/svn/asterisk/trunk@153616 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-19cleaup of the TCP/TLS socket API:kpfleming1-20/+21
1) rename 'struct server_args' to 'struct ast_tcptls_session_args', to follow coding guidelines 2) make ast_make_file_from_fd() static and rename it to something that indicates what it really is for (again coding guidelines) 3) rename address variables inside 'struct ast_tcptls_session_args' to be more descriptive (dare i say it... coding guidelines) 4) change ast_tcptls_client_start() to use the new 'remote_address' field of the session args for the destination of the connection, and use the 'local_address' field to bind() the socket to the proper source address, if one is supplied 5) in chan_sip, ensure that we pass in the PP address we are bound to when creating outbound (client) connections, so that our connections will appear from the correct address git-svn-id: http://svn.digium.com/svn/asterisk/trunk@151101 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiatingtilghman1-1/+2
when a file is invalid from when a file is missing. This is most important when we have two configuration files. Consider the following example: Old system: sip.conf users.conf Old result New result ======== ========== ========== ========== Missing Missing SIP doesn't load SIP doesn't load Missing OK SIP doesn't load SIP doesn't load Missing Invalid SIP doesn't load SIP doesn't load OK Missing SIP loads SIP loads OK OK SIP loads SIP loads OK Invalid SIP loads incompletely SIP doesn't load Invalid Missing SIP doesn't load SIP doesn't load Invalid OK SIP doesn't load SIP doesn't load Invalid Invalid SIP doesn't load SIP doesn't load So in the case when users.conf doesn't load because there's a typo that disrupts the syntax, we may only partially load users, instead of failing with an error, which may cause some calls not to get processed. Worse yet, the old system would do this with no indication that anything was even wrong. (closes issue #10690) Reported by: dtyoo Patches: 20080716__bug10690.diff.txt uploaded by Corydon76 (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@142992 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-10Another big chunk of changes from the RSW branch. Bunch of stuff from main/seanbright1-4/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137082 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-04HTTP module memory leakstilghman1-0/+6
(closes issue #13230) Reported by: eliel Patches: res_http_post_leak.patch uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@135476 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-01Fix mime parsing by re-adding support for passing headers to callback functionstwilson1-0/+19
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@135235 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-31Merged revisions 134983 via svnmerge from kpfleming1-4/+4
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r134983 | kpfleming | 2008-07-31 17:18:11 -0500 (Thu, 31 Jul 2008) | 3 lines accomodate users who seem to lack a sense of humor :-) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@135016 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-29Fix deadlock when unloading res_http_post because the uris lock was still ↵bbryant1-0/+1
locked. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@134253 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-25Committing a fix that was introduced a long timebkruse1-3/+6
ago (does not affect 1.4), where you would pass a pointer to the end of a character array, and ast_uri_decode would do no good. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@133651 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-02Expose the prefix variable so that it can be used by modules depending on ↵twilson1-0/+7
http support git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127545 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-17Updates all usages of ast_tcptls_session_instance to be managed by reference ↵bbryant1-1/+2
counts so that they only get destroyed when all threads are done using them, and memory does not get free'd causing strange issues with SIP. This code was originally written by russellb in the team/group/issue_11972/ branch. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@123546 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-23Add new functionality to http server that requires manager authentication ↵bbryant1-2/+22
for any path that includes a directory named 'private'. This patch also requires manager authentication for any POST's being sent to the server as well to help secure uploads. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@118161 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-20Document the possible presence of multiple variables with therizzo1-7/+27
same name in http queries, which might confuse the manager. Replace calls to ast_uri_decode() with a local function that also replaces '+' with ' ', as this is the normal encoding for spaces in http requests. This allows passing cli commands to the manager through the http interface. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117295 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-20Reverse the check for Cookie: and remove leftover code implementingrizzo1-26/+3
the same thing. Add an ast_debug() call to help debugging the url matching. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117266 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-23Merged revisions 114600 via svnmerge from russell1-45/+42
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114600 | russell | 2008-04-23 17:18:12 -0500 (Wed, 23 Apr 2008) | 6 lines Improve some broken cookie parsing code. Previously, manager login over HTTP would only work if the mansession_id cookie was first. Now, the code builds a list of all of the cookies in the Cookie header. This fixes a problem observed by users of the Asterisk GUI. (closes AST-20) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114601 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-02Re-add HTTP post support by moving to res_http_post.ctwilson1-333/+16
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@112426 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-31Yeah, simplify that logic a bit...twilson1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@112035 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-31Handle blank prefix= in http.conftwilson1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@112033 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-27Fix another little http problem. In making it match coding guidelines, a ↵twilson1-1/+1
comparison was dropped git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111500 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-26Stupid strcasecmp function :-)twilson1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111213 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-26Add the "config reload <conffile>" command, which allows you to tell Asterisktilghman1-1/+1
to reload any file that references a given configuration file. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111012 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-19actually implement HTTP request dispatching based on both URI and method; ↵kpfleming1-81/+101
reduce duplication of data when generating responses using ast_http_error() git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109912 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-19clean up code to conform to coding guidelineskpfleming1-127/+232
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109909 f38db490-d61c-443f-a65b-d21fe96a405b