[asterisk-commits] russell: trunk r61410 - in /trunk: ./ main/http.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Apr 11 07:49:08 MST 2007
Author: russell
Date: Wed Apr 11 09:49:07 2007
New Revision: 61410
URL: http://svn.digium.com/view/asterisk?view=rev&rev=61410
Log:
Merged revisions 61407 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r61407 | russell | 2007-04-11 09:48:01 -0500 (Wed, 11 Apr 2007) | 4 lines
Add "svgz" to the mimetypes table. (issue #9510, bkruse)
In passing, constify the elements of the mimetypes table.
........
Modified:
trunk/ (props changed)
trunk/main/http.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/trunk/main/http.c?view=diff&rev=61410&r1=61409&r2=61410
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Wed Apr 11 09:49:07 2007
@@ -111,8 +111,8 @@
/*! \brief Limit the kinds of files we're willing to serve up */
static struct {
- char *ext;
- char *mtype;
+ const char *ext;
+ const char *mtype;
} mimetypes[] = {
{ "png", "image/png" },
{ "jpg", "image/jpeg" },
@@ -120,6 +120,7 @@
{ "wav", "audio/x-wav" },
{ "mp3", "audio/mpeg" },
{ "svg", "image/svg+xml" },
+ { "svgz", "image/svg+xml" },
{ "gif", "image/gif" },
};
@@ -131,7 +132,7 @@
static AST_RWLIST_HEAD_STATIC(uri_redirects, http_uri_redirect);
-static char *ftype2mtype(const char *ftype, char *wkspace, int wkspacelen)
+static const char *ftype2mtype(const char *ftype, char *wkspace, int wkspacelen)
{
int x;
if (ftype) {
@@ -160,7 +161,8 @@
{
struct ast_str *result;
char *path;
- char *ftype, *mtype;
+ char *ftype;
+ const char *mtype;
char wkspace[80];
struct stat st;
int len;
@@ -178,7 +180,7 @@
if ((ftype = strrchr(uri, '.')))
ftype++;
- mtype=ftype2mtype(ftype, wkspace, sizeof(wkspace));
+ mtype = ftype2mtype(ftype, wkspace, sizeof(wkspace));
/* Cap maximum length */
len = strlen(uri) + strlen(ast_config_AST_DATA_DIR) + strlen("/static-http/") + 5;
More information about the asterisk-commits
mailing list