diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-24 16:15:02 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-24 16:15:02 +0000 |
commit | 0f4bee916929a41fd6cc516cd6276685d283d706 (patch) | |
tree | 351ee64a09deccd3bcfb994d9d84550ff2789e45 /src/transport/transport_api.c | |
parent | 227d261c1ff256be9dea7bf98e5e07f7875dcde0 (diff) | |
download | gnunet-0f4bee916929a41fd6cc516cd6276685d283d706.tar.gz gnunet-0f4bee916929a41fd6cc516cd6276685d283d706.zip |
improving r17722
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 0819a5559..2ececc10d 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -405,6 +405,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
405 | const struct GNUNET_MessageHeader *imm; | 405 | const struct GNUNET_MessageHeader *imm; |
406 | const struct SendOkMessage *okm; | 406 | const struct SendOkMessage *okm; |
407 | const struct QuotaSetMessage *qm; | 407 | const struct QuotaSetMessage *qm; |
408 | const struct GNUNET_ATS_Information *ats; | ||
408 | struct GNUNET_TRANSPORT_GetHelloHandle *hwl; | 409 | struct GNUNET_TRANSPORT_GetHelloHandle *hwl; |
409 | struct GNUNET_TRANSPORT_GetHelloHandle *next_hwl; | 410 | struct GNUNET_TRANSPORT_GetHelloHandle *next_hwl; |
410 | struct Neighbour *n; | 411 | struct Neighbour *n; |
@@ -472,6 +473,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
472 | GNUNET_break (0); | 473 | GNUNET_break (0); |
473 | break; | 474 | break; |
474 | } | 475 | } |
476 | ats = (const struct GNUNET_ATS_Information*) &cim[1]; | ||
475 | #if DEBUG_TRANSPORT_API | 477 | #if DEBUG_TRANSPORT_API |
476 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", | 478 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", |
477 | "CONNECT", GNUNET_i2s (&cim->id)); | 479 | "CONNECT", GNUNET_i2s (&cim->id)); |
@@ -484,7 +486,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
484 | } | 486 | } |
485 | n = neighbour_add (h, &cim->id); | 487 | n = neighbour_add (h, &cim->id); |
486 | if (h->nc_cb != NULL) | 488 | if (h->nc_cb != NULL) |
487 | h->nc_cb (h->cls, &n->id, &cim->ats, ats_count); | 489 | h->nc_cb (h->cls, &n->id, ats, ats_count); |
488 | break; | 490 | break; |
489 | case GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT: | 491 | case GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT: |
490 | if (size != sizeof (struct DisconnectInfoMessage)) | 492 | if (size != sizeof (struct DisconnectInfoMessage)) |
@@ -545,8 +547,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
545 | } | 547 | } |
546 | im = (const struct InboundMessage *) msg; | 548 | im = (const struct InboundMessage *) msg; |
547 | ats_count = ntohl (im->ats_count); | 549 | ats_count = ntohl (im->ats_count); |
548 | imm = (const struct GNUNET_MessageHeader *) &((&(im->ats))[ats_count + 1]); | 550 | ats = (const struct GNUNET_ATS_Information*) &im[1]; |
549 | 551 | imm = (const struct GNUNET_MessageHeader *) &ats[ats_count]; | |
550 | if (ntohs (imm->size) + sizeof (struct InboundMessage) + | 552 | if (ntohs (imm->size) + sizeof (struct InboundMessage) + |
551 | ats_count * sizeof (struct GNUNET_ATS_Information) != size) | 553 | ats_count * sizeof (struct GNUNET_ATS_Information) != size) |
552 | { | 554 | { |
@@ -564,7 +566,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
564 | break; | 566 | break; |
565 | } | 567 | } |
566 | if (h->rec != NULL) | 568 | if (h->rec != NULL) |
567 | h->rec (h->cls, &im->peer, imm, &im->ats, ats_count); | 569 | h->rec (h->cls, &im->peer, imm, ats, ats_count); |
568 | break; | 570 | break; |
569 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: | 571 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: |
570 | #if DEBUG_TRANSPORT_API | 572 | #if DEBUG_TRANSPORT_API |