diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-01-25 17:46:22 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-01-25 17:46:22 +0000 |
commit | 97dc2e1c4fb156c8f4edf69ac794f43dce6e5827 (patch) | |
tree | a01fda67aa4c6b519c042a1b29cf9ec1bdc61800 /src/mesh | |
parent | 3d1cbeafcd29434ab4b9910a55181c14ccfb3437 (diff) | |
download | gnunet-97dc2e1c4fb156c8f4edf69ac794f43dce6e5827.tar.gz gnunet-97dc2e1c4fb156c8f4edf69ac794f43dce6e5827.zip |
- Fixed coverity #10084
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/mesh_api.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 2393d0fbc..74fcbc2ff 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c | |||
@@ -901,8 +901,11 @@ process_peer_event (struct GNUNET_MESH_Handle *h, | |||
901 | * | 901 | * |
902 | * @param h The mesh handle | 902 | * @param h The mesh handle |
903 | * @param message A message encapsulating the data | 903 | * @param message A message encapsulating the data |
904 | * | ||
905 | * @return GNUNET_YES if everything went fine | ||
906 | * GNUNET_NO if client closed connection (h no longer valid) | ||
904 | */ | 907 | */ |
905 | static void | 908 | static int |
906 | process_incoming_data (struct GNUNET_MESH_Handle *h, | 909 | process_incoming_data (struct GNUNET_MESH_Handle *h, |
907 | const struct GNUNET_MessageHeader *message) | 910 | const struct GNUNET_MessageHeader *message) |
908 | { | 911 | { |
@@ -947,12 +950,12 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, | |||
947 | break; | 950 | break; |
948 | default: | 951 | default: |
949 | GNUNET_break (0); | 952 | GNUNET_break (0); |
950 | return; | 953 | return GNUNET_YES; |
951 | } | 954 | } |
952 | if (NULL == t) | 955 | if (NULL == t) |
953 | { | 956 | { |
954 | GNUNET_break (0); | 957 | GNUNET_break (0); |
955 | return; | 958 | return GNUNET_YES; |
956 | } | 959 | } |
957 | type = ntohs (payload->type); | 960 | type = ntohs (payload->type); |
958 | for (i = 0; i < h->n_handlers; i++) | 961 | for (i = 0; i < h->n_handlers; i++) |
@@ -969,7 +972,7 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, | |||
969 | { | 972 | { |
970 | LOG (GNUNET_ERROR_TYPE_DEBUG, "MESH: callback caused disconnection\n"); | 973 | LOG (GNUNET_ERROR_TYPE_DEBUG, "MESH: callback caused disconnection\n"); |
971 | GNUNET_MESH_disconnect (h); | 974 | GNUNET_MESH_disconnect (h); |
972 | return; | 975 | return GNUNET_NO; |
973 | } | 976 | } |
974 | #if MESH_API_DEBUG | 977 | #if MESH_API_DEBUG |
975 | else | 978 | else |
@@ -981,6 +984,7 @@ process_incoming_data (struct GNUNET_MESH_Handle *h, | |||
981 | #endif | 984 | #endif |
982 | } | 985 | } |
983 | } | 986 | } |
987 | return GNUNET_YES; | ||
984 | } | 988 | } |
985 | 989 | ||
986 | 990 | ||
@@ -1021,7 +1025,8 @@ msg_received (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1021 | case GNUNET_MESSAGE_TYPE_MESH_UNICAST: | 1025 | case GNUNET_MESSAGE_TYPE_MESH_UNICAST: |
1022 | case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: | 1026 | case GNUNET_MESSAGE_TYPE_MESH_MULTICAST: |
1023 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: | 1027 | case GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN: |
1024 | process_incoming_data (h, msg); | 1028 | if (GNUNET_NO == process_incoming_data (h, msg)) |
1029 | return; | ||
1025 | break; | 1030 | break; |
1026 | /* We shouldn't get any other packages, log and ignore */ | 1031 | /* We shouldn't get any other packages, log and ignore */ |
1027 | default: | 1032 | default: |