View Issue Details

IDProjectCategoryView StatusLast Update
0001822GNUnetutil librarypublic2011-10-31 12:00
Reportervminko Assigned Tovminko  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Summary0001822: New API call to delete a TransmitContext
DescriptionWe need to have a way to delete a TransmitContext in case of an error between
GNUNET_SERVER_transmit_context_append_data and
GNUNET_SERVER_transmit_context_run.

The proposed fix is attached.
Additional InformationRelated discussion on the forum: https://gnunet.org/node/1363
TagsNo tags attached.
Attached Files
gnunet-svn@17235-tc_destroy.patch (1,317 bytes)   
Index: src/include/gnunet_server_lib.h
===================================================================
--- src/include/gnunet_server_lib.h	(revision 17235)
+++ src/include/gnunet_server_lib.h	(working copy)
@@ -476,7 +476,16 @@
                                     struct GNUNET_TIME_Relative timeout);
 
 
+/**
+ * Destroy a transmission context.
+ *
+ * @param tc transmission context to destroy
+ */
+void
+GNUNET_SERVER_transmit_context_destroy (struct GNUNET_SERVER_TransmitContext
+                                        *tc);
 
+
 /**
  * The notification context is the key datastructure for a conveniance
  * API used for transmission of notifications to the client until the
Index: src/util/server_tc.c
===================================================================
--- src/util/server_tc.c	(revision 17235)
+++ src/util/server_tc.c	(working copy)
@@ -226,4 +226,21 @@
   }
 }
 
+
+/**
+ * Destroy a transmission context.
+ *
+ * @param tc transmission context to destroy
+ */
+void
+GNUNET_SERVER_transmit_context_destroy (struct GNUNET_SERVER_TransmitContext
+                                        *tc)
+{
+  GNUNET_SERVER_receive_done (tc->client, GNUNET_OK);
+  GNUNET_SERVER_client_drop (tc->client);
+  GNUNET_free_non_null (tc->buf);
+  GNUNET_free (tc);
+}
+
+
 /* end of server_tc.c */

Activities

Christian Grothoff

2011-10-06 10:58

manager   ~0004692

Applied (with slight modifications) as SVN 17240.

Issue History

Date Modified Username Field Change
2011-10-06 09:30 vminko New Issue
2011-10-06 09:30 vminko File Added: gnunet-svn@17235-tc_destroy.patch
2011-10-06 09:33 vminko File Deleted: gnunet-svn@17235-tc_destroy.patch
2011-10-06 09:34 vminko File Added: gnunet-svn@17235-tc_destroy.patch
2011-10-06 10:58 Christian Grothoff Note Added: 0004692
2011-10-06 10:58 Christian Grothoff Status new => resolved
2011-10-06 10:58 Christian Grothoff Fixed in Version => Git master
2011-10-06 10:58 Christian Grothoff Resolution open => fixed
2011-10-06 10:58 Christian Grothoff Assigned To => Christian Grothoff
2011-10-06 10:58 Christian Grothoff Assigned To Christian Grothoff => vminko
2011-10-06 10:58 Christian Grothoff Fixed in Version Git master => 0.9.0pre4
2011-10-06 10:58 Christian Grothoff Target Version => 0.9.0pre4
2011-10-31 12:00 Christian Grothoff Status resolved => closed