gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r29065 - in libmicrohttpd/src/testcurl: . https


From: gnunet
Subject: [GNUnet-SVN] r29065 - in libmicrohttpd/src/testcurl: . https
Date: Fri, 6 Sep 2013 13:44:23 +0200

Author: grothoff
Date: 2013-09-06 13:44:22 +0200 (Fri, 06 Sep 2013)
New Revision: 29065

Modified:
   libmicrohttpd/src/testcurl/https/test_https_time_out.c
   libmicrohttpd/src/testcurl/https/tls_test_common.c
   libmicrohttpd/src/testcurl/test_get.c
   libmicrohttpd/src/testcurl/test_quiesce.c
Log:
-nitpicks in tests

Modified: libmicrohttpd/src/testcurl/https/test_https_time_out.c
===================================================================
--- libmicrohttpd/src/testcurl/https/test_https_time_out.c      2013-09-06 
11:41:42 UTC (rev 29064)
+++ libmicrohttpd/src/testcurl/https/test_https_time_out.c      2013-09-06 
11:44:22 UTC (rev 29065)
@@ -62,6 +62,7 @@
   if (ret < 0)
     {
       fprintf (stderr, "Error: %s\n", MHD_E_FAILED_TO_CONNECT);
+      close (sd);
       return -1;
     }
 
@@ -69,6 +70,7 @@
   if (ret < 0)
     {
       fprintf (stderr, "Handshake failed\n");
+      close (sd);
       return -1;
     }
 
@@ -79,6 +81,7 @@
   if (send (sd, "", 1, 0) == 0)
     {
       fprintf (stderr, "Connection failed to time-out\n");
+      close (sd);
       return -1;
     }
 

Modified: libmicrohttpd/src/testcurl/https/tls_test_common.c
===================================================================
--- libmicrohttpd/src/testcurl/https/tls_test_common.c  2013-09-06 11:41:42 UTC 
(rev 29064)
+++ libmicrohttpd/src/testcurl/https/tls_test_common.c  2013-09-06 11:44:22 UTC 
(rev 29065)
@@ -40,8 +40,8 @@
                ca_cert_file_name, strerror (errno));
       return NULL;
     }
-  if (fwrite (ca_cert_pem, sizeof (char), strlen (ca_cert_pem), cert_fd)
-      != strlen (ca_cert_pem))
+  if (fwrite (ca_cert_pem, sizeof (char), strlen (ca_cert_pem) + 1, cert_fd)
+      != strlen (ca_cert_pem) + 1)
     {
       fprintf (stderr, "Error: failed to write `%s. %s'\n",
                ca_cert_file_name, strerror (errno));
@@ -401,7 +401,7 @@
        return -1;
      }
   memcpy (key->data, srv_key_pem, key->size);
-  cert->size = strlen (srv_self_signed_cert_pem);
+  cert->size = strlen (srv_self_signed_cert_pem) + 1;
   cert->data = malloc (cert->size);
   if (cert->data == NULL)
     {

Modified: libmicrohttpd/src/testcurl/test_get.c
===================================================================
--- libmicrohttpd/src/testcurl/test_get.c       2013-09-06 11:41:42 UTC (rev 
29064)
+++ libmicrohttpd/src/testcurl/test_get.c       2013-09-06 11:44:22 UTC (rev 
29065)
@@ -472,6 +472,7 @@
     if (CONNECT (fd, (struct sockaddr *)(&sin), sizeof(sin)) < 0)
     {
        fprintf(stderr, "connect: %m\n");
+       CLOSE (fd);
        return 512;
     }
     

Modified: libmicrohttpd/src/testcurl/test_quiesce.c
===================================================================
--- libmicrohttpd/src/testcurl/test_quiesce.c   2013-09-06 11:41:42 UTC (rev 
29064)
+++ libmicrohttpd/src/testcurl/test_quiesce.c   2013-09-06 11:44:22 UTC (rev 
29065)
@@ -384,8 +384,10 @@
       if (i == 0) {
         /* quiesce the daemon on the 1st iteration, so the 2nd should fail */
         fd = MHD_quiesce_daemon(d);
-        close(fd);
-        c = setupCURL(&cbc);
+       if (-1 == fd)
+         abort ();
+        close (fd);
+        c = setupCURL (&cbc);
         multi = curl_multi_init ();
         mret = curl_multi_add_handle (multi, c);
       }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]