[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14303 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14303 - gnunet/src/transport |
Date: |
Tue, 1 Feb 2011 13:01:07 +0100 |
Author: brodski
Date: 2011-02-01 13:01:07 +0100 (Tue, 01 Feb 2011)
New Revision: 14303
Modified:
gnunet/src/transport/gnunet-transport-wlan-helper.c
gnunet/src/transport/plugin_transport_wlan.c
Log:
Some errors fixed, new debug code.
Modified: gnunet/src/transport/gnunet-transport-wlan-helper.c
===================================================================
--- gnunet/src/transport/gnunet-transport-wlan-helper.c 2011-01-31 18:37:40 UTC
(rev 14302)
+++ gnunet/src/transport/gnunet-transport-wlan-helper.c 2011-02-01 12:01:07 UTC
(rev 14303)
@@ -423,8 +423,8 @@
struct sendbuf *write_pout = cls;
int sendsize;
struct GNUNET_MessageHeader newheader;
- char * from;
- char * to;
+ volatile char * from;
+ volatile char * to;
sendsize = ntohs(hdr->size) - sizeof(struct RadiotapHeader) ;
@@ -447,7 +447,7 @@
memcpy(to, &newheader, sizeof(struct GNUNET_MessageHeader));
write_pout->size += sizeof(struct GNUNET_MessageHeader);
- from = (char *) hdr + sizeof(struct RadiotapHeader) + sizeof(struct
GNUNET_MessageHeader);
+ from = ((char *) hdr) + sizeof(struct RadiotapHeader) + sizeof(struct
GNUNET_MessageHeader);
to = write_pout->buf + write_pout->size;
memcpy(to, from, sendsize - sizeof(struct GNUNET_MessageHeader));
write_pout->size += sendsize - sizeof(struct GNUNET_MessageHeader);
Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c 2011-01-31 18:37:40 UTC
(rev 14302)
+++ gnunet/src/transport/plugin_transport_wlan.c 2011-02-01 12:01:07 UTC
(rev 14303)
@@ -1040,7 +1040,7 @@
struct IeeeHeader * ieeewlanheader = NULL;
struct RadiotapHeader * radioHeader = NULL;
struct GNUNET_MessageHeader * msgheader = NULL;
- struct GNUNET_MessageHeader * msgheader2 = NULL;
+
struct FragmentationHeader fragheader;
struct FragmentationHeader * fragheaderptr = NULL;
struct Finish_send * finish = NULL;
@@ -1050,6 +1050,9 @@
uint copyoffset = 0;
struct AckQueue * akt = NULL;
+#if 0
+ struct GNUNET_MessageHeader * msgheader2 = NULL;
+
//test if a "hello-beacon" has to be send
if (GNUNET_TIME_absolute_get_remaining(plugin->beacon_time).rel_value == 0)
{
@@ -1100,6 +1103,8 @@
}
+#endif
+
fm = plugin->pending_Fragment_Messages_head;
GNUNET_assert(fm != NULL);
session = fm->session;
@@ -1860,7 +1865,7 @@
session_light->session = search_session(plugin, session_light->addr);
}
session = session_light->session;
- wlanheader = (struct WlanHeader *) &hdr;
+ wlanheader = (struct WlanHeader *) hdr;
tempmsg = (char*) &wlanheader[1];
temp_hdr = (const struct GNUNET_MessageHeader *) &wlanheader[1];
@@ -1871,6 +1876,11 @@
return;
}
+#if DEBUG_wlan
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "After crc\n");
+#endif
+
//if not in session list
if (session == NULL)
{
@@ -1878,6 +1888,10 @@
//try if it is a hello message
if (ntohs(temp_hdr->type) == GNUNET_MESSAGE_TYPE_HELLO)
{
+#if DEBUG_wlan
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "New WLAN Client\n");
+#endif
session = create_session(plugin, session_light->addr);
session_light->session = session;
GNUNET_assert(GNUNET_HELLO_get_id(
@@ -1892,15 +1906,30 @@
return;
}
}
+
+#if DEBUG_wlan
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "After session\n");
+#endif
+
//"receive" the message
struct GNUNET_TRANSPORT_ATS_Information distance[2];
distance[0].type = htonl(GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
distance[0].value = htonl(1);
distance[1].type = htonl(GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
distance[1].value = htonl(0);
- plugin->env->receive(plugin, &session->target, temp_hdr,
+#if DEBUG_wlan
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "After Information\n");
+#endif
+ plugin->env->receive(plugin, &(session->target), temp_hdr,
(const struct GNUNET_TRANSPORT_ATS_Information *) &distance, 2,
session, session->addr, sizeof(session->addr));
+#if DEBUG_wlan
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "After receive\n");
+#endif
+
}
else if (ntohs(hdr->type) == GNUNET_MESSAGE_TYPE_WLAN_FRAGMENT)
@@ -2052,6 +2081,11 @@
return;
}
+#if DEBUG_wlan
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
+ "Helper finished\n");
+#endif
+
}
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14303 - gnunet/src/transport,
gnunet <=