]> Nishi Git Mirror - tewi.git/commitdiff
add last-modified [release 2.05]
authorNishi <nishi@nishi.boats>
Sun, 20 Oct 2024 20:23:36 +0000 (20:23 +0000)
committerNishi <nishi@nishi.boats>
Sun, 20 Oct 2024 20:23:36 +0000 (20:23 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@389 8739d7e6-ffea-ec47-b151-bdff447c6205

Document/input/release/index.md
README
Server/server.c
Server/tw_version.h
example.conf

index 47d5be685f9786693ed9c396752079d723d87d70..7b4e0276d9d8688798fdb5629811bd6a693b4e95 100644 (file)
@@ -1,11 +1,7 @@
 \language ^en$
 # New features in version $TCL:VERSION {Release notes}
-## New directives
-### MIMEFile
-Supports the `mime.types` from the Apache HTTPd using `MIMEFile` directive.
+Added last modifed date to the indexing.
 
 \language ^jp$
 # Tewi HTTPd $TCL:VERSION の新機能 {リリース情報}
-## 新しい命令
-### MIMEFile
-`MIMEFile`命令を使用してApache HTTPdの`mime.types`が使えるようになりました。      
+最終更新日時をインデックスに追加しました。
diff --git a/README b/README
index 24fac60606582abc72799a3c99d4dac940ef5c4a..42b0e2ca158b0b0ee4dc4bc670fd0d755ab5f159 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 
-Tewi HTTPd version 2.04
+Tewi HTTPd version 2.05
 
 Original by Nishi <nishi@nishi.boats>
 
index 172059f2049e593728630a6f21f5a04ccbea8d44..432c686be89b3e10c60f0b88c653440a1c01d4cc 100644 (file)
@@ -791,6 +791,7 @@ int tw_server_pass(void* ptr) {
                                                        addstring(&str, "                       <tr>\n");
                                                        addstring(&str, "                               <th></th>\n");
                                                        addstring(&str, "                               <th>Filename</th>\n");
+                                                       addstring(&str, "                               <th>Last-modified</th>\n");
                                                        addstring(&str, "                               <th>MIME</th>\n");
                                                        addstring(&str, "                               <th>Size</th>\n");
                                                        addstring(&str, "                       </tr>\n");
@@ -808,10 +809,14 @@ int tw_server_pass(void* ptr) {
                                                                        char* fpth = cm_strcat3(path, "/", items[i]);
                                                                        struct stat s;
                                                                        char size[512];
+                                                                       char date[512];
                                                                        char* showmime;
                                                                        char* mime;
+                                                                       struct tm* tm;
                                                                        size[0] = 0;
                                                                        stat(fpth, &s);
+                                                                       tm = localtime(&s.st_mtime);
+                                                                       strftime(date, 512, "%a, %d %b %Y %H:%M:%S %Z", tm);
                                                                        if(phase == 0 && !S_ISDIR(s.st_mode)) {
                                                                                free(fpth);
                                                                                continue;
@@ -885,6 +890,7 @@ int tw_server_pass(void* ptr) {
                                                                        addstring(&str, "<tr>\n");
                                                                        addstring(&str, "       <td><img src=\"%s\" alt=\"icon\"></td>\n", icon);
                                                                        addstring(&str, "       <td><a href=\"%l\"><code>%h</code></a></td>\n", items[i], itm);
+                                                                       addstring(&str, "       <td><code>  %h  </code></td>\n", date);
                                                                        addstring(&str, "       <td><code>  %h  </code></td>\n", showmime);
                                                                        addstring(&str, "       <td><code>  %s  </code></td>\n", size);
                                                                        addstring(&str, "</tr>\n");
index c52de72389de1a7e620b574af6f5dd6d427937f0..2d74233cd6e9638702922f4551e48ebfd9d8e650 100644 (file)
@@ -7,8 +7,8 @@
 extern "C" {
 #endif
 
-#define TW_VERSION "2.04\0"
-#define TW_VERSION_TEXT "Tewi HTTPd version 2.04"
+#define TW_VERSION "2.05\0"
+#define TW_VERSION_TEXT "Tewi HTTPd version 2.05"
 
 const char* tw_get_version(void);
 const char* tw_get_platform(void);
index 3742ec4f2ae67e26e45a733079d9c913a670d580..402206ac0fa04f2fcfc606d6201a45f4bc830bf2 100644 (file)
@@ -25,7 +25,7 @@ DirectoryIndex index.html
 
 ReadmeFile README
 
-DocumentRoot /var/www/html
+DocumentRoot /var/www
 
 Define test
 Undefine test