Parcourir la source

wrapped set_ssl_option call into NO_SSL conditional. Fixed test.

Sergey Lyubka il y a 15 ans
Parent
commit
75b6717d8b
2 fichiers modifiés avec 6 ajouts et 4 suppressions
  1. 4 2
      mongoose.c
  2. 2 2
      test/test.pl

+ 4 - 2
mongoose.c

@@ -3853,9 +3853,11 @@ struct mg_context *mg_start(mg_callback_t user_callback, const char **options) {
 
 
   // NOTE(lsm): order is important here. SSL certificates must
   // NOTE(lsm): order is important here. SSL certificates must
   // be initialized before listening ports. UID must be set last.
   // be initialized before listening ports. UID must be set last.
-  if (!set_ssl_option(ctx) ||
+  if (!set_gpass_option(ctx) ||
+#if !defined(NO_SSL)
+      !set_ssl_option(ctx) ||
+#endif
       !set_ports_option(ctx) ||
       !set_ports_option(ctx) ||
-      !set_gpass_option(ctx) ||
 #if !defined(_WIN32)
 #if !defined(_WIN32)
       !set_uid_option(ctx) ||
       !set_uid_option(ctx) ||
 #endif
 #endif

+ 2 - 2
test/test.pl

@@ -385,9 +385,9 @@ sub do_PUT_test {
 
 
 sub do_embedded_test {
 sub do_embedded_test {
   my $cmd = "cc -W -Wall -o $embed_exe $root/embed.c mongoose.c -I. ".
   my $cmd = "cc -W -Wall -o $embed_exe $root/embed.c mongoose.c -I. ".
-  "-pthread -DLISTENING_PORT=\\\"$port\\\"";
+  "-pthread -DNO_SSL -DLISTENING_PORT=\\\"$port\\\"";
   if (on_windows()) {
   if (on_windows()) {
-    $cmd = "cl $root/embed.c mongoose.c /I. /nologo ".
+    $cmd = "cl $root/embed.c mongoose.c /I. /nologo /DNO_SSL ".
     "/DLISTENING_PORT=\\\"$port\\\" /link /out:$embed_exe.exe ws2_32.lib ";
     "/DLISTENING_PORT=\\\"$port\\\" /link /out:$embed_exe.exe ws2_32.lib ";
   }
   }
   print $cmd, "\n";
   print $cmd, "\n";