Mark Nipper wrote:

> Found a possible bug.  The /about entry in the sample configuration
> file contains:
> ---
> Directory /about {
>      Handler server_info     {
>          JustAbout
>      }
> }
> ---
>
> but using that at http://mirror.tamu.edu/about shows:
> ---
> Cherokee Version 0.4.29
>
> and the license.  I assume JustAbout was meant to keep the version
> number from displaying, but it doesn't.  Correct me if I'm wrong.

  The purpose of the JustAbout parameter is to hide the details about
  the server it will be shown if you don't use it.

  Anyway, your comment made me I realize of a related bug. The
  server_info handler doesn't take care of the ServerToken
  parameter. If its value is "Product" the version number should not
  be shown.

  This is the patch (it is committed):

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 92)
+++ ChangeLog   (working copy)
@@ -1,5 +1,13 @@
+2005-11-11  Alvaro Lopez Ortega  <[EMAIL PROTECTED]>
+
+       * cherokee/handler_server_info.c (server_info_build_page): Now it
+       checks the server token parameter in order to show the server
+       version.
+
 2005-11-10  Alvaro Lopez Ortega  <[EMAIL PROTECTED]>

+       * 0.4.29 released
+
        * cherokee/server-protected.h: Removed include_list property.

        * cherokee/read_config_scanner.l, cherokee/read_config_grammar.y:
Index: cherokee/handler_server_info.c
===================================================================
--- cherokee/handler_server_info.c      (revision 86)
+++ cherokee/handler_server_info.c      (working copy)
@@ -72,7 +72,7 @@
 "<table border=\"0\" cellpadding=\"3\" width=\"600\">"                         
                     CRLF\
 "  <tr class=\"h\"><td>"                                                       
                     CRLF\
 "    <a href=\"http://www.0x50.org/\";><img border=\"0\" src=\"?logo\" alt=\"Cherokee Logo\" 
/></a>" CRLF\
-"    <h1 class=\"p\">Cherokee Version " PACKAGE_VERSION "</h1>"                
                     CRLF\
+"    <h1 class=\"p\">Cherokee Version %s</h1>"                                 
                     CRLF\
 "  </td></tr>"                                                                 
                     CRLF\
 "</table><br />"

@@ -299,6 +299,7 @@
 static void
 server_info_build_page (cherokee_handler_server_info_t *hdl)
 {
+       const char        *ver;
        cherokee_server_t *srv;
        cherokee_buffer_t *buf;
        cherokee_buffer_t *table;
@@ -310,8 +311,11 @@

        /* Add the page begining
         */
-       cherokee_buffer_add (buf, PAGE_HEADER, strlen(PAGE_HEADER));
+       ver = (HANDLER_SRV(hdl)->server_token == cherokee_version_product) ?
+               "" : PACKAGE_VERSION;

+       cherokee_buffer_add_va (buf, PAGE_HEADER, ver);
+
        if (! hdl->just_about) {

                /* General table

> Also, I was trying to figure out whether multiple arguments could be
> supplied to the HeaderFile directive.  Looking at the source, that
> doesn't appear to be the case.  How hard would that be to add
> (basically the same as DirectoryIndex)?  I assume the alternative
> way of dealing with this is to define a Directory directive for each
> subdirectory where the HeaderFile option needs to be something
> different?

  Okay, it makes sense. I'm going to take a look at it.. :-)

--
Greetings, alo.
_______________________________________________
Cherokee mailing list
Cherokee@lists.alobbs.com
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to