Fix rps service: restructure channel-related code
authorJulius Bünger <buenger@mytum.de>
Fri, 27 Jul 2018 17:57:03 +0000 (19:57 +0200)
committerJulius Bünger <buenger@mytum.de>
Fri, 27 Jul 2018 17:57:03 +0000 (19:57 +0200)
commit7901ef08d68f9db9a56874f19d6d2b83571e40ba
treef3f20cb727491c0e42f8b553ac8015056d66204a
parente5bce382b3c4b1534da95032cc7f01e2c58ae387
Fix rps service: restructure channel-related code

There is still an error left.
Valgrind reports
==2008== Invalid read of size 8
==2008==    at 0x50662A4: GNUNET_CONTAINER_multipeermap_contains (container_multipeermap.c:542)
==2008==    by 0x114E8A: Peers_remove_peer (gnunet-service-rps.c:1306)
==2008==    by 0x114E65: destroy_peer (gnunet-service-rps.c:1283)
==2008==    by 0x50A29B2: GNUNET_SCHEDULER_do_work (scheduler.c:2104)
==2008==    by 0x50A382D: select_loop (scheduler.c:2400)
==2008==    by 0x509DE48: GNUNET_SCHEDULER_run (scheduler.c:725)
==2008==    by 0x50A989E: GNUNET_SERVICE_run_ (service.c:1875)
==2008==    by 0x11EE83: main (gnunet-service-rps.c:4584)
==2008==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==2008==
==2008==
==2008== Process terminating with default action of signal 11 (SIGSEGV)
==2008==  Access not within mapped region at address 0x0
==2008==    at 0x50662A4: GNUNET_CONTAINER_multipeermap_contains (container_multipeermap.c:542)
==2008==    by 0x114E8A: Peers_remove_peer (gnunet-service-rps.c:1306)
==2008==    by 0x114E65: destroy_peer (gnunet-service-rps.c:1283)
==2008==    by 0x50A29B2: GNUNET_SCHEDULER_do_work (scheduler.c:2104)
==2008==    by 0x50A382D: select_loop (scheduler.c:2400)
==2008==    by 0x509DE48: GNUNET_SCHEDULER_run (scheduler.c:725)
==2008==    by 0x50A989E: GNUNET_SERVICE_run_ (service.c:1875)
==2008==    by 0x11EE83: main (gnunet-service-rps.c:4584)

This seems to only appear at shutdown so it is not dramatic.
src/rps/gnunet-service-rps.c