summaryrefslogtreecommitdiff
path: root/main/http.c
AgeCommit message (Collapse)Author
2011-02-21Add HTTP URI Debug logging and update noticeAndrew Latham
enable reporting of the request URI / URL in debugging change funny debug note to a serious note. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-19Add CSS MIME TypeAndrew Latham
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: https://origsvn.digium.com/svn/asterisk/trunk@308331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04Replace ast_log(LOG_DEBUG, ...) with ast_debug()Paul Belanger
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-31Asterisk HTTP response Content-typeAndrew Latham
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: https://origsvn.digium.com/svn/asterisk/trunk@305084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-24According to section 19.1.2 of RFC 3261:Matthew Nicholson
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: https://origsvn.digium.com/svn/asterisk/trunk@303509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-29Enable IPv6 for the built-in HTTP server.Mark Michelson
Review: https://reviewboard.asterisk.org/r/986 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-27Merged revisions 279726 via svnmerge from Paul Belanger
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: https://origsvn.digium.com/svn/asterisk/trunk@279727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08Add IPv6 to Asterisk.Mark Michelson
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: https://origsvn.digium.com/svn/asterisk/trunk@274783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-15Don't continue sending the file when there has been an errorTerry Wilson
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: https://origsvn.digium.com/svn/asterisk/trunk@270692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23Don't act like an http write failed when it didn'tTerry Wilson
fwrite returns the number of items written, not the number of bytes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-02Adding external reference for doxygenOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-31Fix a trunk compilation warning.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15More 'static' qualifiers on module global variables.Kevin P. Fleming
The 'pglobal' tool is quite handy indeed :-) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29Consistent SSL/TLS options across conf filesDavid Vossel
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: https://origsvn.digium.com/svn/asterisk/trunk@191028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24TLS/SSL private key optionDavid Vossel
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: https://origsvn.digium.com/svn/asterisk/trunk@190545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23Support HTTP digest authentication for the http manager interface.Tilghman Lesher
(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: https://origsvn.digium.com/svn/asterisk/trunk@190349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10Modify headers and macros, according to Russell's suggestions on the -dev listTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-23Allow browsers to cache images and other static content.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-17Fix qualify for TCP peerTerry Wilson
(closes issue #14192) Reported by: pabelanger Patches: asterisk-bug14192.diff.txt uploaded by jamesgolovich (license 176) Tested by: jamesgolovich git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13Merge ast_str_opaque branch (discontinue usage of ast_str internals)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05Janitor, use ARRAY_LEN() when possible.Eliel C. Sardanons
(closes issue #13990) Reported by: eliel Patches: array_len.diff uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 ↵Kevin P. Fleming
branch, and add the ones needed for all the new code here too git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19cleaup of the TCP/TLS socket API:Kevin P. Fleming
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: https://origsvn.digium.com/svn/asterisk/trunk@151101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12Create a new config file status, CONFIG_STATUS_FILEINVALID for differentiatingTilghman Lesher
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: https://origsvn.digium.com/svn/asterisk/trunk@142992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-10Another big chunk of changes from the RSW branch. Bunch of stuff from main/Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-04HTTP module memory leaksTilghman Lesher
(closes issue #13230) Reported by: eliel Patches: res_http_post_leak.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-01Fix mime parsing by re-adding support for passing headers to callback functionsTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31Merged revisions 134983 via svnmerge from Kevin P. Fleming
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: https://origsvn.digium.com/svn/asterisk/trunk@135016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-29Fix deadlock when unloading res_http_post because the uris lock was still ↵Brett Bryant
locked. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25Committing a fix that was introduced a long timeBrandon Kruse
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: https://origsvn.digium.com/svn/asterisk/trunk@133651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02Expose the prefix variable so that it can be used by modules depending on ↵Terry Wilson
http support git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17Updates all usages of ast_tcptls_session_instance to be managed by reference ↵Brett Bryant
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: https://origsvn.digium.com/svn/asterisk/trunk@123546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23Add new functionality to http server that requires manager authentication ↵Brett Bryant
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: https://origsvn.digium.com/svn/asterisk/trunk@118161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-20Document the possible presence of multiple variables with theLuigi Rizzo
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: https://origsvn.digium.com/svn/asterisk/trunk@117295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-20Reverse the check for Cookie: and remove leftover code implementingLuigi Rizzo
the same thing. Add an ast_debug() call to help debugging the url matching. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@117266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23Merged revisions 114600 via svnmerge from Russell Bryant
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: https://origsvn.digium.com/svn/asterisk/trunk@114601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-02Re-add HTTP post support by moving to res_http_post.cTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-31Yeah, simplify that logic a bit...Terry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-31Handle blank prefix= in http.confTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112033 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27Fix another little http problem. In making it match coding guidelines, a ↵Terry Wilson
comparison was dropped git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26Stupid strcasecmp function :-)Terry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26Add the "config reload <conffile>" command, which allows you to tell AsteriskTilghman Lesher
to reload any file that references a given configuration file. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19actually implement HTTP request dispatching based on both URI and method; ↵Kevin P. Fleming
reduce duplication of data when generating responses using ast_http_error() git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19clean up code to conform to coding guidelinesKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19Minor change to use Asterisk macrosRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18start the process of changing HTTP request dispatching to do it based on ↵Kevin P. Fleming
*both* URI and method, so that POST support can move into a module; move http.c's private function prototypes into _private.h git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17Replace minimime with superior GMime library so that the entire contents of ↵Terry Wilson
an http post are not read into memory. This does introduce a dependency on the GMime library for handling HTTP POSTs, but it is available in most distros. If the library is present, then the compile flag for ENABLE_UPLOADS is enabled by default in menuselect. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12Make the default prefix empty, like it was in Asterisk 1.4.Russell Bryant
(closes issue #12198, reported by bkruse, patched by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12Rename ast_tcptls_server_instance to session_instance, since this pertains toRussell Bryant
server and client usage. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108295 65c4cc65-6c06-0410-ace0-fbb531ad65f3