diff --git a/config/Config.in b/config/Config.in index c68e95a66..f434bde45 100644 --- a/config/Config.in +++ b/config/Config.in @@ -48,6 +48,13 @@ config CONFIG_DEBUG Most people should answer N. +config CONFIG_STRIP_UNWANTED_SECTIONS + depends on !CONFIG_PLATFORM_WIN32 && !CONFIG_DEBUG + bool "Strip unwanted sections from elf binaries" + default y + help + Strip unwanted sections from the resulting binaries + menu "Microsoft Compiler Options" depends on CONFIG_PLATFORM_WIN32 diff --git a/config/makefile.conf b/config/makefile.conf index e19b56563..4255dbe46 100644 --- a/config/makefile.conf +++ b/config/makefile.conf @@ -89,7 +89,7 @@ LDSHARED = -shared # Linux ifndef CONFIG_PLATFORM_CYGWIN -CFLAGS += -fPIC +# CFLAGS += -fPIC # Cygwin else diff --git a/httpd/Makefile b/httpd/Makefile index 57dabb6b1..bbc72274b 100644 --- a/httpd/Makefile +++ b/httpd/Makefile @@ -84,11 +84,9 @@ ifndef CONFIG_PLATFORM_WIN32 $(TARGET): $(OBJ) $(AXTLS_HOME)/$(STAGE)/libaxtls.a $(LD) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) -ifndef CONFIG_DEBUG -ifndef CONFIG_PLATFORM_SOLARIS +ifdef CONFIG_STRIP_UNWANTED_SECTIONS strip --remove-section=.comment $(TARGET) endif -endif $(TARGET2): htpasswd.o $(AXTLS_HOME)/$(STAGE)/libaxtls.a $(LD) $(LDFLAGS) -o $@ htpasswd.o $(LIBS) diff --git a/httpd/proc.c b/httpd/proc.c index 8a760039e..32127e862 100644 --- a/httpd/proc.c +++ b/httpd/proc.c @@ -1026,8 +1026,13 @@ static void send_error(struct connstruct *cn, int err) static const char *getmimetype(const char *name) { - /* only bother with two types - let the browser/OS figure the rest out */ - return strstr(name, ".htm") ? "text/html" : "application/octet-stream"; + /* only bother with a few mime types - let the browser figure the rest out */ + if (strstr(name, ".htm")) + return "text/html"; + else if (strstr(name, ".css")) + return "text/css"; + else + return "application/octet-stream"; } static int special_write(struct connstruct *cn, diff --git a/samples/c/Makefile b/samples/c/Makefile index 3fecbe66f..c1cdb4c6e 100644 --- a/samples/c/Makefile +++ b/samples/c/Makefile @@ -48,11 +48,9 @@ ifndef CONFIG_PLATFORM_WIN32 $(TARGET): $(OBJ) $(LIBS)/libaxtls.a $(LD) $(LDFLAGS) -o $@ $(OBJ) -L$(LIBS) -laxtls -ifndef CONFIG_DEBUG -ifndef CONFIG_PLATFORM_SOLARIS +ifdef CONFIG_STRIP_UNWANTED_SECTIONS strip --remove-section=.comment $(TARGET) -endif # SOLARIS -endif # CONFIG_DEBUG +endif # use strip else # Win32 $(TARGET): $(OBJ) diff --git a/ssl/Makefile b/ssl/Makefile index 2ad87021d..d0bfc1149 100644 --- a/ssl/Makefile +++ b/ssl/Makefile @@ -42,7 +42,7 @@ endif # shared library major/minor numbers LIBMAJOR=$(BASETARGET).1 -LIBMINOR=$(BASETARGET).1.1 +LIBMINOR=$(BASETARGET).1.2 else TARGET1=$(AXTLS_HOME)/axtls.lib TARGET2=$(AXTLS_HOME)/$(STAGE)/axtls.dll diff --git a/ssl/test/ssltest.c b/ssl/test/ssltest.c index 737e3d699..469be5141 100644 --- a/ssl/test/ssltest.c +++ b/ssl/test/ssltest.c @@ -1735,7 +1735,7 @@ static void do_header_issue(void) static int header_issue(void) { FILE *f = fopen("../ssl/test/header_issue.dat", "r"); - int server_fd, client_fd, ret = 1; + int server_fd = -1, client_fd = -1, ret = 1; uint8_t buf[2048]; int size = 0; struct sockaddr_in client_addr;