[asterisk-commits] russell: branch 1.4 r61407 -
/branches/1.4/main/http.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Apr 11 07:48:02 MST 2007
Author: russell
Date: Wed Apr 11 09:48:01 2007
New Revision: 61407
URL: http://svn.digium.com/view/asterisk?view=rev&rev=61407
Log:
Add "svgz" to the mimetypes table. (issue #9510, bkruse)
In passing, constify the elements of the mimetypes table.
Modified:
branches/1.4/main/http.c
Modified: branches/1.4/main/http.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/http.c?view=diff&rev=61407&r1=61406&r2=61407
==============================================================================
--- branches/1.4/main/http.c (original)
+++ branches/1.4/main/http.c Wed Apr 11 09:48:01 2007
@@ -79,8 +79,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" },
@@ -88,10 +88,11 @@
{ "wav", "audio/x-wav" },
{ "mp3", "audio/mpeg" },
{ "svg", "image/svg+xml" },
+ { "svgz", "image/svg+xml" },
{ "gif", "image/gif" },
};
-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) {
@@ -109,7 +110,8 @@
char result[4096];
char *c=result;
char *path;
- char *ftype, *mtype;
+ char *ftype;
+ const char *mtype;
char wkspace[80];
struct stat st;
int len;
@@ -128,7 +130,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