- use proper signedness
[oweals/gnunet.git] / src / transport / plugin_transport_unix.c
index 906cf99971c4c5515dc337a6963620420568749e..3a2fa6516f96af5c0f3af7901e5341b5fe339aef 100644 (file)
@@ -906,6 +906,21 @@ unix_plugin_get_session (void *cls,
   return s;
 }
 
+static void
+unix_plugin_update_session_timeout (void *cls,
+                                  const struct GNUNET_PeerIdentity *peer,
+                                  struct Session *session)
+{
+  struct Plugin *plugin = cls;
+
+  if (GNUNET_OK !=
+      GNUNET_CONTAINER_multipeermap_contains_value (plugin->session_map,
+                                                    &session->target,
+                                                    session))
+    return;
+
+  reschedule_session_timeout (session);
+}
 
 /**
  * Function that can be used by the transport service to transmit
@@ -971,7 +986,7 @@ unix_plugin_send (void *cls,
   memcpy (&message->sender, plugin->env->my_identity,
           sizeof (struct GNUNET_PeerIdentity));
   memcpy (&message[1], msgbuf, msgbuf_size);
-  reschedule_session_timeout (session);
+
   wrapper = GNUNET_new (struct UNIXMessageWrapper);
   wrapper->msg = message;
   wrapper->msgsize = ssize;
@@ -1635,6 +1650,7 @@ libgnunet_plugin_transport_unix_init (void *cls)
   api->check_address = &unix_check_address;
   api->string_to_address = &unix_string_to_address;
   api->get_network = &unix_get_network;
+  api->update_session_timeout = &unix_plugin_update_session_timeout;
   sockets_created = unix_transport_server_start (plugin);
   if (0 == sockets_created)
     LOG (GNUNET_ERROR_TYPE_WARNING,