-fix NPE
[oweals/gnunet.git] / src / transport / gnunet-service-transport.c
index 7dfd994b49df8e3601975b0860fd131aa08c8181..9cf4bdcacc44bc1aabc92c3847f917041f655984 100644 (file)
@@ -14,8 +14,8 @@
 
  You should have received a copy of the GNU General Public License
  along with GNUnet; see the file COPYING.  If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
  */
 /**
  * @file transport/gnunet-service-transport.c
@@ -462,6 +462,10 @@ GST_receive_callback (void *cls,
     GST_neighbours_handle_disconnect_message (&address->peer,
                                               message);
     break;
+  case GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_QUOTA:
+    GST_neighbours_handle_quota_message (&address->peer,
+                                         message);
+    break;
   case GNUNET_MESSAGE_TYPE_TRANSPORT_SESSION_KEEPALIVE:
     GST_neighbours_keepalive (&address->peer,
                               message);
@@ -511,23 +515,31 @@ plugin_env_address_change_notification (void *cls,
   if (GNUNET_YES == add_remove)
   {
     addresses ++;
-    GNUNET_STATISTICS_update (cfg, "# transport addresses", 1, GNUNET_NO);
+    GNUNET_STATISTICS_update (cfg,
+                              "# transport addresses",
+                              1,
+                              GNUNET_NO);
   }
   else if (GNUNET_NO == add_remove)
   {
     if (0 == addresses)
+    {
       GNUNET_break (0);
+    }
     else
     {
       addresses --;
-      GNUNET_STATISTICS_update (cfg, "# transport addresses", -1, GNUNET_NO);
+      GNUNET_STATISTICS_update (cfg,
+                                "# transport addresses",
+                                -1,
+                                GNUNET_NO);
     }
   }
-
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Transport now has %u addresses to communicate\n",
               addresses);
-  GST_hello_modify_addresses (add_remove, address);
+  GST_hello_modify_addresses (add_remove,
+                              address);
 }
 
 
@@ -662,6 +674,7 @@ plugin_env_session_start (void *cls,
        may not know the address yet; add if necessary! */
     /* FIXME: maybe change API here so we just pass scope? */
     memset (&prop, 0, sizeof (prop));
+    GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != scope);
     prop.scope = scope;
     GST_ats_add_inbound_address (address,
                                  session,