gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37595 - in gnunet/src: include social


From: gnunet
Subject: [GNUnet-SVN] r37595 - in gnunet/src: include social
Date: Thu, 28 Jul 2016 01:15:28 +0200

Author: lynx
Date: 2016-07-28 01:15:28 +0200 (Thu, 28 Jul 2016)
New Revision: 37595

Modified:
   gnunet/src/include/gnunet_social_service.h
   gnunet/src/social/gnunet-service-social.c
   gnunet/src/social/gnunet-social.c
   gnunet/src/social/social_api.c
   gnunet/src/social/test_social.c
Log:
social: fix various warnings

Modified: gnunet/src/include/gnunet_social_service.h
===================================================================
--- gnunet/src/include/gnunet_social_service.h  2016-07-27 23:15:19 UTC (rev 
37594)
+++ gnunet/src/include/gnunet_social_service.h  2016-07-27 23:15:28 UTC (rev 
37595)
@@ -194,7 +194,7 @@
 
 Messages with a _file method contain a file,
 which is saved to disk upon reception at the following location:
-$GNUNET_DATA_HOME/social/files/<H(place_pub)>/<message_id>
+$GNUNET_DATA_HOME/social/files/<H(place_pub)>/<H(message_id)>
 
 ### Environment
 
@@ -386,7 +386,7 @@
 /**
  * Establish application connection to the social service.
  *
- * The @host_place_cb and @guest_place_cb functions are
+ * The @host_cb and @guest_cb functions are
  * initially called for each entered places,
  * then later each time a new place is entered with the current app ID.
  *
@@ -416,8 +416,12 @@
 /**
  * Disconnect app.
  *
- * @param c
- *        App handle.
+ * @param app
+ *        Application handle.
+ * @param disconnect_cb
+ *        Disconnect callback.
+ * @param disconnect_cls
+ *        Disconnect closure.
  */
 void
 GNUNET_SOCIAL_app_disconnect (struct GNUNET_SOCIAL_App *app,

Modified: gnunet/src/social/gnunet-service-social.c
===================================================================
--- gnunet/src/social/gnunet-service-social.c   2016-07-27 23:15:19 UTC (rev 
37594)
+++ gnunet/src/social/gnunet-service-social.c   2016-07-27 23:15:28 UTC (rev 
37595)
@@ -989,19 +989,23 @@
   struct GNUNET_DISK_FileHandle *
     fh = GNUNET_DISK_file_open (filename, GNUNET_DISK_OPEN_WRITE,
                                 GNUNET_DISK_PERM_NONE);
-  GNUNET_free (filename);
-
   if (NULL != fh)
   {
-    GNUNET_DISK_file_seek (fh, plc->file_offset, GNUNET_DISK_SEEK_SET);
+    if (plc->file_offset != GNUNET_DISK_file_seek
+         (fh, plc->file_offset, GNUNET_DISK_SEEK_SET)) {
+        GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "seek", filename);
+       GNUNET_free (filename);
+       return;
+    }
     GNUNET_DISK_file_write (fh, data, data_size);
     GNUNET_DISK_file_close (fh);
+    GNUNET_free (filename);
   }
   else
   {
+    GNUNET_free (filename);
     GNUNET_break (0);
   }
-
   plc->file_offset += data_size;
 }
 
@@ -1033,7 +1037,11 @@
   char *fn_part = NULL;
   GNUNET_asprintf (&fn_part, "%s.part", fn);
 
-  rename (fn_part, fn);
+  if (rename (fn_part, fn)) {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Failed to rename %s into %s: %s (%d)\n",
+                 fn_part, fn, strerror (errno), errno);
+  }
 
   GNUNET_free (fn);
   GNUNET_free (fn_part);
@@ -1098,8 +1106,8 @@
  *
  * @param app_id
  *        Application ID.
- * @param msg
- *        Entry message.
+ * @param ereq
+ *        Entry request.
  *
  * @return #GNUNET_OK if the place was added
  *         #GNUNET_NO if the place already exists in the hash map
@@ -1183,8 +1191,8 @@
  *
  * @param app_id
  *        Application ID.
- * @param msg
- *        Entry message.
+ * @param ereq
+ *        Entry request message.
  */
 static int
 app_place_save (const char *app_id,
@@ -1302,8 +1310,8 @@
 /**
  * Enter place as host.
  *
- * @param req
- *        Entry request.
+ * @param hreq
+ *        Host entry request.
  * @param[out] ret_hst
  *        Returned Host struct.
  *
@@ -1541,8 +1549,8 @@
 /**
  * Enter place as guest.
  *
- * @param req
- *        Entry request.
+ * @param greq
+ *        Guest entry request.
  * @param[out] ret_gst
  *        Returned Guest struct.
  *
@@ -1589,6 +1597,7 @@
     len = strnlen (app_id, remaining);
     if (len == remaining)
     {
+      GNUNET_free (gst);
       GNUNET_break (0);
       return GNUNET_SYSERR;
     }
@@ -1623,8 +1632,8 @@
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   "%zu + %u + %u != %u\n",
                   sizeof (*greq), relay_size, join_msg_size, greq_size);
+      GNUNET_free (gst);
       GNUNET_break (0);
-      GNUNET_free (gst);
       return GNUNET_SYSERR;
     }
     if (0 < relay_size)
@@ -2595,10 +2604,8 @@
 /**
  * Get method part of next message from transmission queue.
  *
- * @param tmit_msg
- *        Next item in message transmission queue.
- * @param[out] pmeth
- *        The malloc'd message method is returned here.
+ * @param plc
+ *        Place
  *
  * @return #GNUNET_OK on success
  *         #GNUNET_NO if there are no more messages in queue.

Modified: gnunet/src/social/gnunet-social.c
===================================================================
--- gnunet/src/social/gnunet-social.c   2016-07-27 23:15:19 UTC (rev 37594)
+++ gnunet/src/social/gnunet-social.c   2016-07-27 23:15:28 UTC (rev 37595)
@@ -1055,9 +1055,9 @@
               const struct GNUNET_CRYPTO_EcdsaPublicKey *pub_key,
               const char *name)
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-              "Ego:   %s\t%s\n",
-              GNUNET_CRYPTO_ecdsa_public_key_to_string (pub_key), name);
+  char *s = GNUNET_CRYPTO_ecdsa_public_key_to_string (pub_key);
+  GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Ego:   %s\t%s\n", s, name);
+  GNUNET_free (s);
 
   if (0 == memcmp (&ego_pub_key, pub_key, sizeof (*pub_key))
       || (NULL != opt_ego && 0 == strcmp (opt_ego, name)))
@@ -1107,7 +1107,7 @@
  * @param cls closure
  * @param args remaining command-line arguments
  * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
- * @param cfg configuration
+ * @param c configuration
  */
 static void
 run (void *cls, char *const *args, const char *cfgfile,

Modified: gnunet/src/social/social_api.c
===================================================================
--- gnunet/src/social/social_api.c      2016-07-27 23:15:19 UTC (rev 37594)
+++ gnunet/src/social/social_api.c      2016-07-27 23:15:28 UTC (rev 37595)
@@ -2452,11 +2452,13 @@
  *        Configuration.
  * @param id
  *        Application ID.
- * @param notify_host
+ * @param ego_cb
+ *        Function to notify about an available ego.
+ * @param host_cb
  *        Function to notify about a place entered as host.
- * @param notify_guest
- *        Function to notify about a place entered as guest..
- * @param notify_cls
+ * @param guest_cb
+ *        Function to notify about a place entered as guest.
+ * @param cls
  *        Closure for the callbacks.
  *
  * @return Handle that can be used to stop listening.
@@ -2507,6 +2509,10 @@
  *
  * @param app
  *        Application handle.
+ * @param disconnect_cb
+ *        Disconnect callback.
+ * @param disconnect_cls
+ *        Disconnect closure.
  */
 void
 GNUNET_SOCIAL_app_disconnect (struct GNUNET_SOCIAL_App *app,

Modified: gnunet/src/social/test_social.c
===================================================================
--- gnunet/src/social/test_social.c     2016-07-27 23:15:19 UTC (rev 37594)
+++ gnunet/src/social/test_social.c     2016-07-27 23:15:28 UTC (rev 37595)
@@ -1082,7 +1082,7 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
               "Test #%u: Host received entry request from guest (try %u).\n",
-              test, join_req_count);
+              (uint8_t) test, join_req_count);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "%s\n%.*s\n",
               method_name, data_size, (const char *) data);




reply via email to

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