diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-31 08:25:37 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-01-31 08:25:37 +0000 |
commit | 31b3cceaa950713ede6a69b1ccb52a298ed54a08 (patch) | |
tree | 846a2f3d06d7573d50f11900a6ab2c5969a5a61b /src | |
parent | 0d90a33f83606133e2883e66c83eb932c7faaa31 (diff) | |
download | gnunet-31b3cceaa950713ede6a69b1ccb52a298ed54a08.tar.gz gnunet-31b3cceaa950713ede6a69b1ccb52a298ed54a08.zip |
fixing const api and add check to address
Diffstat (limited to 'src')
-rw-r--r-- | src/ats/ats_api_scheduling.c | 4 | ||||
-rw-r--r-- | src/hello/address.c | 2 | ||||
-rw-r--r-- | src/include/gnunet_ats_service.h | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index b3d644023..dd70b634f 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -759,7 +759,7 @@ get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
759 | * @return location as GNUNET_ATS_Information | 759 | * @return location as GNUNET_ATS_Information |
760 | */ | 760 | */ |
761 | 761 | ||
762 | struct GNUNET_ATS_Information | 762 | const struct GNUNET_ATS_Information |
763 | GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const struct sockaddr * addr, socklen_t addrlen) | 763 | GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const struct sockaddr * addr, socklen_t addrlen) |
764 | { | 764 | { |
765 | GNUNET_assert (sh != NULL); | 765 | GNUNET_assert (sh != NULL); |
@@ -868,7 +868,7 @@ GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle * sh, const stru | |||
868 | 868 | ||
869 | ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); | 869 | ats.type = htonl (GNUNET_ATS_NETWORK_TYPE); |
870 | ats.value = htonl (type); | 870 | ats.value = htonl (type); |
871 | return ats; | 871 | return (const struct GNUNET_ATS_Information) ats; |
872 | } | 872 | } |
873 | 873 | ||
874 | /** | 874 | /** |
diff --git a/src/hello/address.c b/src/hello/address.c index 618aa6e6a..893a6dc91 100644 --- a/src/hello/address.c +++ b/src/hello/address.c | |||
@@ -46,6 +46,8 @@ GNUNET_HELLO_address_allocate (const struct GNUNET_PeerIdentity *peer, | |||
46 | size_t slen; | 46 | size_t slen; |
47 | char *end; | 47 | char *end; |
48 | 48 | ||
49 | GNUNET_assert (transport_name != NULL); | ||
50 | |||
49 | slen = strlen (transport_name) + 1; | 51 | slen = strlen (transport_name) + 1; |
50 | addr = | 52 | addr = |
51 | GNUNET_malloc (sizeof (struct GNUNET_HELLO_Address) + address_length + | 53 | GNUNET_malloc (sizeof (struct GNUNET_HELLO_Address) + address_length + |
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index 0db277597..9f5fed29d 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -542,7 +542,7 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SchedulingHandle *sh, | |||
542 | * @param addrlen address length | 542 | * @param addrlen address length |
543 | * @return location as GNUNET_ATS_Information | 543 | * @return location as GNUNET_ATS_Information |
544 | */ | 544 | */ |
545 | struct GNUNET_ATS_Information | 545 | const struct GNUNET_ATS_Information |
546 | GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, | 546 | GNUNET_ATS_address_get_type (struct GNUNET_ATS_SchedulingHandle *sh, |
547 | const struct sockaddr * addr, | 547 | const struct sockaddr * addr, |
548 | socklen_t addrlen); | 548 | socklen_t addrlen); |