diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-04-15 16:47:24 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-04-15 16:47:24 +0000 |
commit | e12c75e08bfe443be2b72749a3c65ba47521b9aa (patch) | |
tree | 1425ba375161466bb96cd8908a5087426a381b4e /src/util/resolver_api.c | |
parent | 1f96c16ec17861a81d52bbaa9e6bf0b7cafa36f3 (diff) | |
download | gnunet-e12c75e08bfe443be2b72749a3c65ba47521b9aa.tar.gz gnunet-e12c75e08bfe443be2b72749a3c65ba47521b9aa.zip |
Diffstat (limited to 'src/util/resolver_api.c')
-rw-r--r-- | src/util/resolver_api.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index 96396bfcc..9e54282fa 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c | |||
@@ -671,33 +671,26 @@ GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, | |||
671 | /** | 671 | /** |
672 | * Get local hostname | 672 | * Get local hostname |
673 | * | 673 | * |
674 | * @param sched scheduler to use | 674 | * @param |
675 | * @param cfg configuration to use | ||
676 | * @param callback function to call with addresses | ||
677 | * @param cls closure for callback | ||
678 | * @return handle that can be used to cancel the request, NULL on error | ||
679 | */ | 675 | */ |
680 | void | 676 | char * |
681 | GNUNET_RESOLVER_local_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, | 677 | GNUNET_RESOLVER_local_hostname_get ( ) |
682 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
683 | GNUNET_RESOLVER_HostnameCallback callback, | ||
684 | void *cls) | ||
685 | { | 678 | { |
686 | 679 | ||
687 | char hostname[GNUNET_OS_get_hostname_max_length() + 1]; | 680 | char hostname[GNUNET_OS_get_hostname_max_length() + 1]; |
688 | 681 | ||
689 | check_config (cfg); | 682 | |
690 | if (0 != gethostname (hostname, sizeof (hostname) - 1)) | 683 | if (0 != gethostname (hostname, sizeof (hostname) - 1)) |
691 | { | 684 | { |
692 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | | 685 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | |
693 | GNUNET_ERROR_TYPE_BULK, "gethostname"); | 686 | GNUNET_ERROR_TYPE_BULK, "gethostname"); |
694 | return; | 687 | return NULL; |
695 | } | 688 | } |
696 | #if DEBUG_RESOLVER | 689 | #if DEBUG_RESOLVER |
697 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 690 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
698 | _("Resolving our hostname `%s'\n"), hostname); | 691 | _("Resolving our hostname `%s'\n"), hostname); |
699 | #endif | 692 | #endif |
700 | callback (cls, hostname); | 693 | return GNUNET_strdup (hostname); |
701 | } | 694 | } |
702 | 695 | ||
703 | /** | 696 | /** |