diff options
Diffstat (limited to 'src/transport/plugin_transport_wlan.c')
-rw-r--r-- | src/transport/plugin_transport_wlan.c | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 51e8991b9..b0be34346 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -1395,6 +1395,7 @@ process_data (void *cls, | |||
1395 | struct Plugin *plugin = cls; | 1395 | struct Plugin *plugin = cls; |
1396 | struct GNUNET_HELLO_Address *address; | 1396 | struct GNUNET_HELLO_Address *address; |
1397 | struct MacAndSession *mas = client; | 1397 | struct MacAndSession *mas = client; |
1398 | struct MacAndSession xmas; | ||
1398 | struct GNUNET_ATS_Information ats; | 1399 | struct GNUNET_ATS_Information ats; |
1399 | struct FragmentMessage *fm; | 1400 | struct FragmentMessage *fm; |
1400 | struct GNUNET_PeerIdentity tmpsource; | 1401 | struct GNUNET_PeerIdentity tmpsource; |
@@ -1447,17 +1448,6 @@ process_data (void *cls, | |||
1447 | &mas->endpoint->wlan_addr, | 1448 | &mas->endpoint->wlan_addr, |
1448 | sizeof (mas->endpoint->wlan_addr), | 1449 | sizeof (mas->endpoint->wlan_addr), |
1449 | GNUNET_HELLO_ADDRESS_INFO_INBOUND); | 1450 | GNUNET_HELLO_ADDRESS_INFO_INBOUND); |
1450 | mas->session = lookup_session (mas->endpoint, | ||
1451 | &tmpsource); | ||
1452 | if (NULL == mas->session) | ||
1453 | { | ||
1454 | mas->session = create_session (mas->endpoint, | ||
1455 | &tmpsource); | ||
1456 | plugin->env->session_start (plugin->env->cls, | ||
1457 | address, | ||
1458 | mas->session, | ||
1459 | &ats, 1); | ||
1460 | } | ||
1461 | plugin->env->receive (plugin->env->cls, | 1451 | plugin->env->receive (plugin->env->cls, |
1462 | address, | 1452 | address, |
1463 | mas->session, | 1453 | mas->session, |
@@ -1567,34 +1557,34 @@ process_data (void *cls, | |||
1567 | GNUNET_NO); | 1557 | GNUNET_NO); |
1568 | break; | 1558 | break; |
1569 | } | 1559 | } |
1570 | mas->session = lookup_session (mas->endpoint, | 1560 | xmas.endpoint = mas->endpoint; |
1571 | &wlanheader->sender); | 1561 | if (NULL == (xmas.session = lookup_session (mas->endpoint, |
1572 | if (NULL == mas->session) | 1562 | &wlanheader->sender))) |
1573 | { | 1563 | { |
1574 | mas->session = create_session (mas->endpoint, | 1564 | xmas.session = create_session (mas->endpoint, |
1575 | &wlanheader->sender); | 1565 | &wlanheader->sender); |
1576 | address = GNUNET_HELLO_address_allocate (&wlanheader->sender, | 1566 | address = GNUNET_HELLO_address_allocate (&wlanheader->sender, |
1577 | PLUGIN_NAME, | 1567 | PLUGIN_NAME, |
1578 | &mas->endpoint->wlan_addr, | 1568 | &mas->endpoint->wlan_addr, |
1579 | sizeof (struct WlanAddress), | 1569 | sizeof (struct WlanAddress), |
1580 | GNUNET_HELLO_ADDRESS_INFO_NONE); | 1570 | GNUNET_HELLO_ADDRESS_INFO_NONE); |
1581 | plugin->env->session_start (plugin->env->cls, | 1571 | plugin->env->session_start (NULL, |
1582 | address, | 1572 | address, |
1583 | mas->session, | 1573 | xmas.session, |
1584 | NULL, 0); | 1574 | NULL, 0); |
1585 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1575 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1586 | "Notifying transport about peer `%s''s new session %p \n", | 1576 | "Notifying transport about peer `%s''s new session %p \n", |
1587 | GNUNET_i2s (&wlanheader->sender), | 1577 | GNUNET_i2s (&wlanheader->sender), |
1588 | mas->session); | 1578 | xmas.session); |
1589 | GNUNET_HELLO_address_free (address); | 1579 | GNUNET_HELLO_address_free (address); |
1590 | } | 1580 | } |
1591 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1581 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1592 | "Processing %u bytes of DATA from peer `%s'\n", | 1582 | "Processing %u bytes of DATA from peer `%s'\n", |
1593 | (unsigned int) msize, | 1583 | (unsigned int) msize, |
1594 | GNUNET_i2s (&wlanheader->sender)); | 1584 | GNUNET_i2s (&wlanheader->sender)); |
1595 | mas->session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); | 1585 | xmas.session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); |
1596 | (void) GNUNET_SERVER_mst_receive (plugin->wlan_header_payload_tokenizer, | 1586 | (void) GNUNET_SERVER_mst_receive (plugin->wlan_header_payload_tokenizer, |
1597 | mas, | 1587 | &xmas, |
1598 | (const char *) &wlanheader[1], | 1588 | (const char *) &wlanheader[1], |
1599 | msize - sizeof (struct WlanHeader), | 1589 | msize - sizeof (struct WlanHeader), |
1600 | GNUNET_YES, | 1590 | GNUNET_YES, |
@@ -2198,12 +2188,9 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
2198 | GNUNET_BANDWIDTH_value_init (100 * 1024 * | 2188 | GNUNET_BANDWIDTH_value_init (100 * 1024 * |
2199 | 1024 / 8), | 2189 | 1024 / 8), |
2200 | 100); | 2190 | 100); |
2201 | plugin->fragment_data_tokenizer = GNUNET_SERVER_mst_create (&process_data, | 2191 | plugin->fragment_data_tokenizer = GNUNET_SERVER_mst_create (&process_data, plugin); |
2202 | plugin); | 2192 | plugin->wlan_header_payload_tokenizer = GNUNET_SERVER_mst_create (&process_data, plugin); |
2203 | plugin->wlan_header_payload_tokenizer = GNUNET_SERVER_mst_create (&process_data, | 2193 | plugin->helper_payload_tokenizer = GNUNET_SERVER_mst_create (&process_data, plugin); |
2204 | plugin); | ||
2205 | plugin->helper_payload_tokenizer = GNUNET_SERVER_mst_create (&process_data, | ||
2206 | plugin); | ||
2207 | plugin->beacon_task = GNUNET_SCHEDULER_add_now (&send_hello_beacon, | 2194 | plugin->beacon_task = GNUNET_SCHEDULER_add_now (&send_hello_beacon, |
2208 | plugin); | 2195 | plugin); |
2209 | 2196 | ||