diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-03 09:34:15 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-03 09:34:15 +0000 |
commit | 7d6e6b045a300cf753e685bc18ec0b1e264d1a25 (patch) | |
tree | 2e7069a9bfb46aef0ea9a45b944fbc934aaa2ce1 /src/transport | |
parent | 84bcdbdd34bfa4d597ae2635146fe15631b46f44 (diff) | |
download | gnunet-7d6e6b045a300cf753e685bc18ec0b1e264d1a25.tar.gz gnunet-7d6e6b045a300cf753e685bc18ec0b1e264d1a25.zip |
fix for bug #0003416: do not stop parsing uri when plugin is not found
- changed semantics for address generator cb: GNUNET_SYSERR indicates stop, >= 0 indicates bytes added
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_hello.c | 11 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_validation.c | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c index 626be54c1..49992222d 100644 --- a/src/transport/gnunet-service-transport_hello.c +++ b/src/transport/gnunet-service-transport_hello.c | |||
@@ -133,17 +133,18 @@ struct GeneratorContext | |||
133 | * @param cls the 'struct GeneratorContext' | 133 | * @param cls the 'struct GeneratorContext' |
134 | * @param max maximum number of bytes left | 134 | * @param max maximum number of bytes left |
135 | * @param buf where to write the address | 135 | * @param buf where to write the address |
136 | * @return bytes written or GNUNET_SYSERR to signal the | ||
137 | * end of the iteration. | ||
136 | */ | 138 | */ |
137 | static size_t | 139 | static ssize_t |
138 | address_generator (void *cls, size_t max, void *buf) | 140 | address_generator (void *cls, size_t max, void *buf) |
139 | { | 141 | { |
140 | struct GeneratorContext *gc = cls; | 142 | struct GeneratorContext *gc = cls; |
141 | size_t ret; | 143 | ssize_t ret; |
142 | 144 | ||
143 | if (NULL == gc->addr_pos) | 145 | if (NULL == gc->addr_pos) |
144 | return 0; | 146 | return GNUNET_SYSERR; /* Done */ |
145 | ret = | 147 | ret = GNUNET_HELLO_add_address (gc->addr_pos->address, gc->expiration, buf, |
146 | GNUNET_HELLO_add_address (gc->addr_pos->address, gc->expiration, buf, | ||
147 | max); | 148 | max); |
148 | gc->addr_pos = gc->addr_pos->next; | 149 | gc->addr_pos = gc->addr_pos->next; |
149 | return ret; | 150 | return ret; |
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index eb3f4c07d..7c2675df3 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -1280,16 +1280,16 @@ validate_address_iterator (void *cls, | |||
1280 | * @param cls the 'struct ValidationEntry' with the validated address | 1280 | * @param cls the 'struct ValidationEntry' with the validated address |
1281 | * @param max space in buf | 1281 | * @param max space in buf |
1282 | * @param buf where to add the address | 1282 | * @param buf where to add the address |
1283 | * @return number of bytes written, 0 to signal the | 1283 | * @return number of bytes written, GNUNET_SYSERR to signal the |
1284 | * end of the iteration. | 1284 | * end of the iteration. |
1285 | */ | 1285 | */ |
1286 | static size_t | 1286 | static ssize_t |
1287 | add_valid_peer_address (void *cls, size_t max, void *buf) | 1287 | add_valid_peer_address (void *cls, size_t max, void *buf) |
1288 | { | 1288 | { |
1289 | struct ValidationEntry *ve = cls; | 1289 | struct ValidationEntry *ve = cls; |
1290 | 1290 | ||
1291 | if (GNUNET_YES == ve->copied) | 1291 | if (GNUNET_YES == ve->copied) |
1292 | return 0; /* terminate */ | 1292 | return GNUNET_SYSERR; /* Done */ |
1293 | ve->copied = GNUNET_YES; | 1293 | ve->copied = GNUNET_YES; |
1294 | return GNUNET_HELLO_add_address (ve->address, ve->valid_until, buf, max); | 1294 | return GNUNET_HELLO_add_address (ve->address, ve->valid_until, buf, max); |
1295 | } | 1295 | } |