diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-14 18:27:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-14 18:27:42 +0000 |
commit | 20bc0ad630965adedb63c8eacf96a118f5d7ed0b (patch) | |
tree | 08cdf3939c844893b7f486c5223382a4f70e1a3d /src/transport/transport_api.c | |
parent | 40d50986ed7aa7be0f3921dae39423e2bcaef682 (diff) | |
download | gnunet-20bc0ad630965adedb63c8eacf96a118f5d7ed0b.tar.gz gnunet-20bc0ad630965adedb63c8eacf96a118f5d7ed0b.zip |
fix
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 73d1ebac9..239983983 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -80,7 +80,6 @@ struct NeighbourList | |||
80 | */ | 80 | */ |
81 | struct GNUNET_TRANSPORT_TransmitHandle *transmit_handle; | 81 | struct GNUNET_TRANSPORT_TransmitHandle *transmit_handle; |
82 | 82 | ||
83 | |||
84 | /** | 83 | /** |
85 | * Identity of this neighbour. | 84 | * Identity of this neighbour. |
86 | */ | 85 | */ |
@@ -1034,13 +1033,7 @@ try_connect_task (void *cls, | |||
1034 | { | 1033 | { |
1035 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; | 1034 | struct GNUNET_TRANSPORT_TransmitHandle *th = cls; |
1036 | 1035 | ||
1037 | th->notify_delay_task | 1036 | th->notify_delay_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; |
1038 | = GNUNET_SCHEDULER_add_delayed (th->handle->sched, | ||
1039 | GNUNET_NO, | ||
1040 | GNUNET_SCHEDULER_PRIORITY_KEEP, | ||
1041 | GNUNET_SCHEDULER_NO_PREREQUISITE_TASK, | ||
1042 | GNUNET_TIME_absolute_get_remaining | ||
1043 | (th->timeout), &transmit_timeout, th); | ||
1044 | try_connect (th); | 1037 | try_connect (th); |
1045 | } | 1038 | } |
1046 | 1039 | ||
@@ -1085,18 +1078,16 @@ remove_neighbour (struct GNUNET_TRANSPORT_Handle *h, | |||
1085 | pos->transmit_handle = NULL; | 1078 | pos->transmit_handle = NULL; |
1086 | th->neighbour = NULL; | 1079 | th->neighbour = NULL; |
1087 | remove_from_any_list (th); | 1080 | remove_from_any_list (th); |
1088 | if (GNUNET_TIME_absolute_get_remaining (th->timeout).value > CONNECT_RETRY_TIMEOUT.value) | 1081 | if (GNUNET_TIME_absolute_get_remaining (th->timeout).value <= CONNECT_RETRY_TIMEOUT.value) |
1089 | { | 1082 | { |
1090 | /* signal error */ | 1083 | /* signal error */ |
1091 | GNUNET_SCHEDULER_cancel (h->sched, | 1084 | GNUNET_assert (GNUNET_SCHEDULER_NO_PREREQUISITE_TASK == th->notify_delay_task); |
1092 | th->notify_delay_task); | ||
1093 | transmit_timeout (th, NULL); | 1085 | transmit_timeout (th, NULL); |
1094 | } | 1086 | } |
1095 | else | 1087 | else |
1096 | { | 1088 | { |
1097 | /* try again in a bit */ | 1089 | /* try again in a bit */ |
1098 | GNUNET_SCHEDULER_cancel (h->sched, | 1090 | GNUNET_assert (GNUNET_SCHEDULER_NO_PREREQUISITE_TASK == th->notify_delay_task); |
1099 | th->notify_delay_task); | ||
1100 | th->notify_delay_task | 1091 | th->notify_delay_task |
1101 | = GNUNET_SCHEDULER_add_delayed (h->sched, | 1092 | = GNUNET_SCHEDULER_add_delayed (h->sched, |
1102 | GNUNET_NO, | 1093 | GNUNET_NO, |
@@ -1665,8 +1656,6 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1665 | "Receiving `%s' message, transmission %s.\n", "SEND_OK", | 1656 | "Receiving `%s' message, transmission %s.\n", "SEND_OK", |
1666 | ntohl(okm->success) == GNUNET_OK ? "succeeded" : "failed"); | 1657 | ntohl(okm->success) == GNUNET_OK ? "succeeded" : "failed"); |
1667 | #endif | 1658 | #endif |
1668 | /* FIXME: need to check status code and change action accordingly, | ||
1669 | especially if the error was for CONNECT */ | ||
1670 | n = find_neighbour (h, &okm->peer); | 1659 | n = find_neighbour (h, &okm->peer); |
1671 | GNUNET_assert (n != NULL); | 1660 | GNUNET_assert (n != NULL); |
1672 | n->transmit_ok = GNUNET_YES; | 1661 | n->transmit_ok = GNUNET_YES; |
@@ -1674,7 +1663,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1674 | { | 1663 | { |
1675 | #if DEBUG_TRANSPORT | 1664 | #if DEBUG_TRANSPORT |
1676 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1665 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1677 | "Processing pending message\n"); | 1666 | "Processing pending message for `%4s'\n", |
1667 | GNUNET_i2s(&n->id)); | ||
1678 | #endif | 1668 | #endif |
1679 | GNUNET_SCHEDULER_cancel (h->sched, | 1669 | GNUNET_SCHEDULER_cancel (h->sched, |
1680 | n->transmit_handle->notify_delay_task); | 1670 | n->transmit_handle->notify_delay_task); |