From a6f43190ab793b3487da2133735e166e337000c4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 12 Mar 2010 13:29:05 +0000 Subject: cancel pending write if we are just dead anyway --- src/include/gnunet_connection_lib.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/include/gnunet_connection_lib.h') diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index 570431165..0f6ae21e3 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h @@ -197,15 +197,23 @@ int GNUNET_CONNECTION_get_address (struct *sock, void **addr, size_t * addrlen); + /** - * Close the socket and free associated resources. Pending - * transmissions are simply dropped. A pending receive call will be - * called with an error code of "EPIPE". + * Close the socket and free associated resources. Pending + * transmissions may be completed or dropped depending on the + * arguments. If a receive call is pending and should + * NOT be completed, 'GNUNET_CONNECTION_receive_cancel' + * should be called explicitly first. * * @param sock socket to destroy + * @param finish_pending_write should pending writes be completed or aborted? + * (this applies to transmissions where the data has already been + * read from the application; all other transmissions should be + * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). */ -void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle - *sock); +void +GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, + int finish_pending_write); /** -- cgit v1.2.3