diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2014-05-08 09:55:00 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2014-05-08 09:55:00 +0000 |
commit | 0662fe7c87b12dcbbac17d523526468e80eb59d8 (patch) | |
tree | 5e75245aad7a1d0d3d05da15d50cf5cf495c9328 /src/scalarproduct | |
parent | 65f58f9840a36af8d034a9fb6e139bed44683f01 (diff) | |
download | gnunet-0662fe7c87b12dcbbac17d523526468e80eb59d8.tar.gz gnunet-0662fe7c87b12dcbbac17d523526468e80eb59d8.zip |
- proper service-side error reporting for the SP API
Diffstat (limited to 'src/scalarproduct')
-rw-r--r-- | src/scalarproduct/scalarproduct_api.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/scalarproduct/scalarproduct_api.c b/src/scalarproduct/scalarproduct_api.c index 297b3505e..9c497129a 100644 --- a/src/scalarproduct/scalarproduct_api.c +++ b/src/scalarproduct/scalarproduct_api.c | |||
@@ -228,11 +228,7 @@ receive_cb (void *cls, const struct GNUNET_MessageHeader *msg) | |||
228 | LOG (GNUNET_ERROR_TYPE_WARNING, "Disconnected by Service.\n"); | 228 | LOG (GNUNET_ERROR_TYPE_WARNING, "Disconnected by Service.\n"); |
229 | status = GNUNET_SCALARPRODUCT_Status_ServiceDisconnected; | 229 | status = GNUNET_SCALARPRODUCT_Status_ServiceDisconnected; |
230 | } | 230 | } |
231 | else if (GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT != ntohs (msg->type)) | 231 | else if ((GNUNET_SYSERR != message->status) && (0 < message->product_length )) |
232 | { | ||
233 | LOG (GNUNET_ERROR_TYPE_WARNING, "Invalid message type received\n"); | ||
234 | } | ||
235 | else if (0 < ntohl (message->product_length) || (0 == message->range)) | ||
236 | { | 232 | { |
237 | // response for the responder client, successful | 233 | // response for the responder client, successful |
238 | GNUNET_STATISTICS_update (h->stats, | 234 | GNUNET_STATISTICS_update (h->stats, |
@@ -241,7 +237,11 @@ receive_cb (void *cls, const struct GNUNET_MessageHeader *msg) | |||
241 | 237 | ||
242 | status = GNUNET_SCALARPRODUCT_Status_Success; | 238 | status = GNUNET_SCALARPRODUCT_Status_Success; |
243 | } | 239 | } |
244 | 240 | else if (message->status == GNUNET_SYSERR){ | |
241 | // service signaled an error | ||
242 | status = GNUNET_SCALARPRODUCT_Status_Failure; | ||
243 | } | ||
244 | |||
245 | if (h->cont_status != NULL) | 245 | if (h->cont_status != NULL) |
246 | h->response_proc (h, msg, status); | 246 | h->response_proc (h, msg, status); |
247 | 247 | ||