[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11856 - in gnunet/src: include transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11856 - in gnunet/src: include transport |
Date: |
Mon, 21 Jun 2010 23:06:48 +0200 |
Author: grothoff
Date: 2010-06-21 23:06:48 +0200 (Mon, 21 Jun 2010)
New Revision: 11856
Modified:
gnunet/src/include/gnunet_server_lib.h
gnunet/src/transport/plugin_transport_udp.c
Log:
nate on code sonar crack
Modified: gnunet/src/include/gnunet_server_lib.h
===================================================================
--- gnunet/src/include/gnunet_server_lib.h 2010-06-21 20:05:10 UTC (rev
11855)
+++ gnunet/src/include/gnunet_server_lib.h 2010-06-21 21:06:48 UTC (rev
11856)
@@ -610,6 +610,60 @@
+/**
+ * Handle to a message stream tokenizer.
+ */
+struct GNUNET_SERVER_MessageStreamTokenizer;
+
+/**
+ * Functions with this signature are called whenever a
+ * complete message is received by the tokenizer.
+ *
+ * @param cls closure
+ * @param client identification of the client
+ * @param message the actual message
+ */
+typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls,
+ void *client,
+ const struct
+ GNUNET_MessageHeader *
+ message);
+
+
+/**
+ * Create a message stream tokenizer.
+ *
+ * @param maxbuf maximum message size to support (typically
+ * GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ * @param client_identity ID of client for which this is a buffer,
+ * can be NULL (will be passed back to 'cb')
+ * @return handle to tokenizer
+ */
+struct GNUNET_SERVER_MessageStreamTokenizer *
+GNUNET_SERVER_mst_create (size_t maxbuf,
+ void *client_identity,
+ GNUNET_SERVER_MessageTokenizerCallback cb,
+ void *cls);
+
+
+/**
+ *
+ */
+void
+GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst,
+ const char *buf,
+ size_t size,
+ int purge);
+
+/**
+ * Destroys a tokenizer.
+ *
+ * @param mst tokenizer to destroy
+ */
+void
+GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst);
+
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2010-06-21 20:05:10 UTC (rev
11855)
+++ gnunet/src/transport/plugin_transport_udp.c 2010-06-21 21:06:48 UTC (rev
11856)
@@ -751,7 +751,7 @@
v4 = (struct sockaddr_in *) addr;
if ((plugin->behind_nat == GNUNET_YES) && (plugin->only_nat_addresses ==
GNUNET_YES))
{
- v4->sin_port = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_MESSAGE); /*
Indicates to receiver we are behind NAT */
+ v4->sin_port = htons (0); /* Indicates to receiver we are behind NAT
*/
}
else if (plugin->behind_nat == GNUNET_YES) /* We are behind NAT, but
will advertise NAT and normal addresses */
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11856 - in gnunet/src: include transport,
gnunet <=