gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r19444 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r19444 - gnunet/src/transport
Date: Thu, 26 Jan 2012 16:32:28 +0100

Author: wachs
Date: 2012-01-26 16:32:28 +0100 (Thu, 26 Jan 2012)
New Revision: 19444

Modified:
   gnunet/src/transport/gnunet-service-transport_neighbours.c
   gnunet/src/transport/plugin_transport_tcp.c
Log:
- session sending in tcp


Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2012-01-26 
15:20:38 UTC (rev 19443)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2012-01-26 
15:32:28 UTC (rev 19444)
@@ -63,7 +63,7 @@
 
 #define SETUP_CONNECTION_TIMEOUT GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 15)
 
-#define  TEST_NEW_CODE GNUNET_NO
+#define  TEST_NEW_CODE GNUNET_YES
 
 /**
  * Entry in neighbours.
@@ -1884,7 +1884,8 @@
   /* try QUICKLY to re-establish a connection, reduce timeout! */
   if (n->ats_suggest != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel (n->ats_suggest);
-  n->ats_suggest = GNUNET_SCHEDULER_add_delayed (ATS_RESPONSE_TIMEOUT, 
&ats_suggest_cancel,
+  n->ats_suggest = GNUNET_SCHEDULER_add_delayed (ATS_RESPONSE_TIMEOUT,
+                                    &ats_suggest_cancel,
                                     n);
   GNUNET_ATS_suggest_address (GST_ats, peer);
 }

Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2012-01-26 15:20:38 UTC (rev 
19443)
+++ gnunet/src/transport/plugin_transport_tcp.c 2012-01-26 15:32:28 UTC (rev 
19444)
@@ -932,7 +932,7 @@
  *         and does NOT mean that the message was not transmitted (DV and NAT)
  */
 static ssize_t
-tcp_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target,
+tcp_plugin_send_old (void *cls, const struct GNUNET_PeerIdentity *target,
                  const char *msg, size_t msgbuf_size, uint32_t priority,
                  struct GNUNET_TIME_Relative timeout, struct Session *session,
                  const void *addr, size_t addrlen, int force_address,
@@ -1202,24 +1202,15 @@
  * a fresh connection to another peer.
  *
  * @param cls closure
- * @param target who should receive this message
- * @param msg the message to transmit
- * @param msgbuf_size number of bytes in 'msg'
+ * @param session which session must be used
+ * @param msgbuf the message to transmit
+ * @param msgbuf_size number of bytes in 'msgbuf'
  * @param priority how important is the message (most plugins will
  *                 ignore message priority and just FIFO)
- * @param timeout how long to wait at most for the transmission (does not
+ * @param to how long to wait at most for the transmission (does not
  *                require plugins to discard the message after the timeout,
  *                just advisory for the desired delay; most plugins will ignore
  *                this as well)
- * @param session which session must be used (or NULL for "any")
- * @param addr the address to use (can be NULL if the plugin
- *                is "on its own" (i.e. re-use existing TCP connection))
- * @param addrlen length of the address in bytes
- * @param force_address GNUNET_YES if the plugin MUST use the given address,
- *                GNUNET_NO means the plugin may use any other address and
- *                GNUNET_SYSERR means that only reliable existing
- *                bi-directional connections should be used (regardless
- *                of address)
  * @param cont continuation to call once the message has
  *        been transmitted (or if the transport is ready
  *        for the next transmission call; or if the
@@ -1227,10 +1218,10 @@
  * @param cont_cls closure for cont
  * @return number of bytes used (on the physical network, with overheads);
  *         -1 on hard errors (i.e. address invalid); 0 is a legal value
- *         and does NOT mean that the message was not transmitted (DV and NAT)
+ *         and does NOT mean that the message was not transmitted (DV)
  */
 static ssize_t
-tcp_plugin_send_new (void *cls,
+tcp_plugin_send (void *cls,
     struct Session *session,
     const char *msgbuf, size_t msgbuf_size,
     unsigned int priority,
@@ -1240,6 +1231,7 @@
   struct Plugin * plugin = cls;
   struct PendingMessage *pm;
 
+  GNUNET_assert (plugin != NULL);
   GNUNET_assert (session != NULL);
   GNUNET_assert (session->client != NULL);
 
@@ -1306,7 +1298,7 @@
  * @return the session if the address is valid, NULL otherwise
  */
 static struct Session *
-tcp_plugin_create_session (void *cls,
+tcp_plugin_get_session (void *cls,
                       const struct GNUNET_HELLO_Address *address)
 {
   struct Plugin * plugin = cls;
@@ -2281,10 +2273,10 @@
   }
   api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions));
   api->cls = plugin;
-  api->send = &tcp_plugin_send;
+  api->send = &tcp_plugin_send_old;
 
-  api->send_with_session = &tcp_plugin_send_new;
-  api->get_session = &tcp_plugin_create_session;
+  api->send_with_session = &tcp_plugin_send;
+  api->get_session = &tcp_plugin_get_session;
 
   api->disconnect = &tcp_plugin_disconnect;
   api->address_pretty_printer = &tcp_plugin_address_pretty_printer;




reply via email to

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