gnunet_procs.append (p)
for p in gnunet_procs:
if re.match (r'gnunet-service-arm', p[1]):
- print ("killing arm {0:5} {1}".format (p[0], p[1]))
- os.kill (p[0], signal.SIGTERM)
+ print ("killing arm process {0:5} {1}".format (p[0], p[1]))
+ try:
+ os.kill (p[0], signal.SIGTERM)
+ except OSError as e:
+ print ("failed: {0}".format (e))
+ pass
for p in gnunet_procs:
if not re.match (r'gnunet-service-arm', p[1]):
- print ("killing arm {0:5} {1}".format (p[0], p[1]))
- os.kill (p[0], signal.SIGTERM)
+ print ("killing non-arm process {0:5} {1}".format (p[0], p[1]))
+ try:
+ os.kill (p[0], signal.SIGTERM)
+ except OSError as e:
+ print ("failed: {0}".format (e))
+ pass
if __name__ == '__main__':
sys.exit (main ())
GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber);
-
/**
* Allocate and initialize memory. Checks the return value, aborts if no more
* memory is available. Don't use GNUNET_xmemdup_ directly. Use the
unsigned int newCount, const char *filename, int linenumber);
+/**
+ * Create a copy of the given message.
+ *
+ * @param msg message to copy
+ * @return duplicate of the message
+ */
+struct GNUNET_MessageHeader *
+GNUNET_copy_message (const struct GNUNET_MessageHeader *msg);
#if __STDC_VERSION__ < 199901L
* @param info function to call with the resulting configuration information
* @param info_cls closure for info
* @return NULL on error
+ * @deprecated will be replaced soon
*/
struct GNUNET_CORE_InformationRequestContext *
GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h,
* from the original request will no longer be called.
*
* @param irc context returned by the original GNUNET_CORE_peer_get_info call
+ * @deprecated will be replaced soon
*/
void
GNUNET_CORE_peer_change_preference_cancel (struct
/**
- * Iterate over all connected peers.
+ * Iterate over all connected peers. Calls peer_cb with each
+ * connected peer, and then once with NULL to indicate that all peers
+ * have been handled.
*
* @param cfg configuration handle
* @param peer_cb function to call with the peer information
GNUNET_CORE_ConnectEventHandler peer_cb,
void *cb_cls);
+
/**
- * Iterate over all currently connected peers.
- * Calls peer_cb with each connected peer, and then
- * once with NULL to indicate that all peers have
- * been handled.
+ * Check if the given peer is currently connected and return information
+ * about the session if so.
*
* @param cfg configuration to use
* @param peer the specific peer to check for
return ret;
}
+
+/**
+ * Create a copy of the given message.
+ *
+ * @param msg message to copy
+ * @return duplicate of the message
+ */
+struct GNUNET_MessageHeader *
+GNUNET_copy_message (const struct GNUNET_MessageHeader *msg)
+{
+ struct GNUNET_MessageHeader *ret;
+ uint16_t msize;
+
+ msize = ntohs (msg->size);
+ GNUNET_assert (msize >= sizeof (struct GNUNET_MessageHeader));
+ ret = GNUNET_malloc (msize);
+ memcpy (ret, msg, msize);
+ return ret;
+}
+
+
/* end of common_allocation.c */