Procházet zdrojové kódy

fixing memory leak

Christian Grothoff před 15 roky
rodič
revize
d728fa1b45
4 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 1 0
      AUTHORS
  2. 4 0
      ChangeLog
  3. 1 0
      src/daemon/daemon.c
  4. 3 1
      src/examples/minimal_example.c

+ 1 - 0
AUTHORS

@@ -23,6 +23,7 @@ Mika Raento <[email protected]>
 Mike Crowe <[email protected]>
 John Muth <[email protected]>
 Geoffrey McRae <[email protected]>
+Piotr Grzybowski <[email protected]>
 
 Documentation contributions also came from:
 Marco Maggi <[email protected]>

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+Fri Aug  6 12:51:59 CEST 2010
+	Fixing (small) memory leak on daemon-shutdown with
+	SSL enabled. -CG/PG
+
 Thu Aug  5 22:24:37 CEST 2010
 	Fixing timeout bug on systems that think it's still
 	1970 (can happen if system time not initialized). -CG

+ 1 - 0
src/daemon/daemon.c

@@ -1938,6 +1938,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
 #if HTTPS_SUPPORT
   if (daemon->options & MHD_USE_SSL)
     {
+      gnutls_priority_deinit (daemon->priority_cache);
       if (daemon->x509_cred)
         gnutls_certificate_free_credentials (daemon->x509_cred);
       /* lock MHD_gnutls_global mutex since it uses reference counting */

+ 3 - 1
src/examples/minimal_example.c

@@ -68,7 +68,9 @@ main (int argc, char *const *argv)
     }
   d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
                         atoi (argv[1]),
-                        NULL, NULL, &ahc_echo, PAGE, MHD_OPTION_END);
+                        NULL, NULL, &ahc_echo, PAGE,
+			MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 5,
+			MHD_OPTION_END);
   if (d == NULL)
     return 1;
   (void) getc (stdin);