]> Nishi Git Mirror - tewi.git/commitdiff
fix fopen stuff
authorNishi <nishi@nishi.boats>
Thu, 26 Sep 2024 21:18:46 +0000 (21:18 +0000)
committerNishi <nishi@nishi.boats>
Thu, 26 Sep 2024 21:18:46 +0000 (21:18 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@173 8739d7e6-ffea-ec47-b151-bdff447c6205

README
Server/server.c
Server/tw_version.h
config.h.tmpl

diff --git a/README b/README
index f1460f6978a3554c161f74882e46ecf207a0d5d0..3d69562787a9223d431ceda0f6c91364519734fe 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 
-Tewi HTTPd version 1.08C
+Tewi HTTPd version 1.08D
 
 Original by Nishi <nishi@nishi.boats>
 
index 8f66162b0a177debfb6f2f751ee52aac777d2bd6..40d9d817483ab1c9767d98df2928d2cf281bb99d 100644 (file)
@@ -796,8 +796,12 @@ int32_t tw_server_pass(void* ptr) {
                                        char* mime = tw_get_mime(ext, vhost_entry);
                                        if(ext != NULL) free(ext);
                                        FILE* f = fopen(path, "rb");
-                                       tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
-                                       fclose(f);
+                                       if(f == NULL) {
+                                               tw_http_error(s, sock, 403, name, port, vhost_entry);
+                                       } else {
+                                               tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
+                                               fclose(f);
+                                       }
                                }
                        } else {
                                if(!rej) {
index ada4f4d19d18e68cd6d18ff659e409969f20b51d..440d863c19854531b08acd383906fac556e01615 100644 (file)
@@ -7,7 +7,7 @@
 extern "C" {
 #endif
 
-#define TW_VERSION "1.08C\0"
+#define TW_VERSION "1.08D\0"
 
 const char* tw_get_version(void);
 const char* tw_get_platform(void);
index 7b18bff825254a96412740a2eabdfe5199cd7ff1..da0c04ef30d9011c7b92e93ec0f982f42661888a 100644 (file)
@@ -5,6 +5,7 @@
 
 #define SERVER_ADMIN "webmaster@domain"
 
+#undef NO_IPV6
 #undef NO_SSL
 #define USE_POLL
 #define HAS_CHROOT