[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [3000] Improved MIME types documentation.
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [3000] Improved MIME types documentation. |
Date: |
Sat, 07 Feb 2009 10:15:53 +0000 |
Revision: 3000
http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3000
Author: gscrivano
Date: 2009-02-07 10:15:52 +0000 (Sat, 07 Feb 2009)
Log Message:
-----------
Improved MIME types documentation. `SEND' is used to specify static files.
Modified Paths:
--------------
trunk/myserver/documentation/mime_types.texi
trunk/myserver/src/protocol/http/http.cpp
Modified: trunk/myserver/documentation/mime_types.texi
===================================================================
--- trunk/myserver/documentation/mime_types.texi 2009-02-06 20:17:01 UTC
(rev 2999)
+++ trunk/myserver/documentation/mime_types.texi 2009-02-07 10:15:52 UTC
(rev 3000)
@@ -1,22 +1,38 @@
@c -*-texinfo-*-
-You can modify the MIME types used by MyServer by modifying the file
address@hidden The following is an example of this file:
+MIME types are used to specify the type of information a resource
+transmitted to or from the server contains.
+Some standard MIME types are already defined in the
address@hidden file.
+Using the same syntax you can define new MIME types or modify existing
+ones. For each MIME type it is possible to specify how the server
+will handle the files and which actions take before it can be sent to
+the client.
+In this example two MIME types are defined:
+
@example
-<?xml version ="1.0"?>
<MIME mime="text/html" handler="SEND" param="">
<EXTENSION value="html"/>
+<FILTER value="gzip"/>
</MIME>
-<MIME mime="text/html" handler="RUNCGI" param="/usr/bin/perl"
selfExecuted="NO">
-<FILTER value="gzip"/>
+<MIME mime="text/html" handler="CGI" param="/usr/bin/perl" selfExecuted="NO">
<EXTENSION value="pl"/>
<DEFINE name="http.error.file.404" value="404.html"/>
</MIME>
@end example
+The former defines to send any file with a @code{.html} extension as
+it is, in case it is supported by the client then the file content is
+compressed using the gzip.
+The latter specifies that every file with a @code{pl} extension are
+handled by the @file{/usr/bin/perl} CGI and the new process standard
+output is redirected to the client. In addition, it defines which
+resource use when a 404 HTTP file not found error happens.
+
+Every MIME type is made of:
+
@itemize
-Each block describes a different MIME type.
@item mime
the MIME attribute specifies the MIME name.
@@ -54,34 +70,43 @@
they will be applied in the specified order.
@code{<DEFINE>} It defines a new value for a variable, take a look
-here @xref{Security files} for more details on the @code{<DEFINE>}
+here @ref{Security files} for more details on the @code{<DEFINE>}
element.
The same MIME type can have several extensions, you will need to
specify a different @code{<EXTENSION>} element for each extension.
These are valid HTTP handlers:
+
@enumerate
@item SEND
-Send the file statically as is. This command is used for files
+Send the file statically as it is. This command is used for files
extensions such as .html and .jpg that don't need any external
intervention from the web server.
@item CGI
-Run the CGI script indicated in the path. It is used for file
+Run the CGI script indicated in the handler. It is used for file
extensions such as .php and .pl that need to be processed before
-sending any data to the client.
+sending any data to the client. Every request requires the execution
+of a new process.
@item FASTCGI
-Run the Fastcgi script. This type will need a fastcgi parser
-downloaded (see the PHP page). It is also used for file extensions
-such as .php and .pl.
+Run the script using the FastCGI server specified in the handler.
+Differently than CGI, a new process is not spawned on every request
+but it is done opening a connection to the specified FastCGI server.
@item SCGI
-Handle a specified mime type with this SCGI server.
+Like FastCGI, it is designed as a replacement for the CGI protocol.
@item MSCGI
Run the MSCGI script. This library is only available for MyServer. It
is used to build fast and efficient CGIs that needs to access MyServer
-internal data.
+internal data. It is not portable, don't use unless you are going to
+write something that can be used only for MyServer.
@item ISAPI
-Run the ISAPI script.
+Run the ISAPI module. It is available only under the Microsoft
+Windows operating system thus it is not portable or can be used on a
+Free operating system.
address@hidden WINCGI
+This protocol is obsoleted by ISAPI. As CGI it needs a new process
+for every request and it uses files to communicate with the web
+server. It is very inefficient.
@end enumerate
It is possible to match the file name against a regular expression
Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp 2009-02-06 20:17:01 UTC (rev
2999)
+++ trunk/myserver/src/protocol/http/http.cpp 2009-02-07 10:15:52 UTC (rev
3000)
@@ -858,7 +858,7 @@
if (!(td->permissions & MYSERVER_PERMISSION_READ))
return sendAuth ();
- manager = staticHttp.dynManagerList.getHttpManager ("FILE");
+ manager = staticHttp.dynManagerList.getHttpManager ("SEND");
if (!manager)
return raiseHTTPError (500);
@@ -2036,7 +2036,7 @@
HttpFile::load (configurationFileManager);
HttpDir::load (configurationFileManager);
- staticHttp.dynManagerList.addHttpManager ("FILE", staticHttp.httpFile);
+ staticHttp.dynManagerList.addHttpManager ("SEND", staticHttp.httpFile);
staticHttp.dynManagerList.addHttpManager ("DIR", staticHttp.httpDir);
staticHttp.dynManagerList.addHttpManager ("CGI", staticHttp.cgi);
staticHttp.dynManagerList.addHttpManager ("MSCGI", staticHttp.mscgi);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [3000] Improved MIME types documentation.,
Giuseppe Scrivano <=