diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-29 08:06:44 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-04-29 08:06:44 +0200 |
commit | 60d45f936ee2e864b3c7f5c1fef7b83fab71ecd1 (patch) | |
tree | 7d2e80f805ebfbf8276ddbaa93e25659d709bd37 /src/rest/gnunet-rest-server.c | |
parent | b648db0820be371cd4f782bb3ca1b6a80766980f (diff) | |
download | gnunet-60d45f936ee2e864b3c7f5c1fef7b83fab71ecd1.tar.gz gnunet-60d45f936ee2e864b3c7f5c1fef7b83fab71ecd1.zip |
REST: trigger start; fix port
Diffstat (limited to 'src/rest/gnunet-rest-server.c')
-rw-r--r-- | src/rest/gnunet-rest-server.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index 3cbb750ba..813525404 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c | |||
@@ -11,7 +11,7 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
@@ -597,7 +597,7 @@ schedule_httpd () | |||
597 | GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, | 597 | GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
598 | tv, wrs, wws, | 598 | tv, wrs, wws, |
599 | &do_httpd, NULL); | 599 | &do_httpd, NULL); |
600 | 600 | ||
601 | } | 601 | } |
602 | if (NULL != wrs) | 602 | if (NULL != wrs) |
603 | GNUNET_NETWORK_fdset_destroy (wrs); | 603 | GNUNET_NETWORK_fdset_destroy (wrs); |
@@ -822,6 +822,18 @@ run (void *cls, | |||
822 | cfg = c; | 822 | cfg = c; |
823 | plugin_map = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); | 823 | plugin_map = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); |
824 | 824 | ||
825 | /* Get port to bind to */ | ||
826 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, "rest", | ||
827 | "PORT", | ||
828 | &port)) | ||
829 | { | ||
830 | //No address specified | ||
831 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
832 | "Don't know what port to use...\n"); | ||
833 | GNUNET_SCHEDULER_shutdown (); | ||
834 | return; | ||
835 | } | ||
836 | |||
825 | /* Get address to bind to */ | 837 | /* Get address to bind to */ |
826 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest", | 838 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest", |
827 | "BIND_TO", | 839 | "BIND_TO", |
@@ -830,7 +842,6 @@ run (void *cls, | |||
830 | //No address specified | 842 | //No address specified |
831 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 843 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
832 | "Don't know what to bind to...\n"); | 844 | "Don't know what to bind to...\n"); |
833 | GNUNET_free (addr_str); | ||
834 | GNUNET_SCHEDULER_shutdown (); | 845 | GNUNET_SCHEDULER_shutdown (); |
835 | return; | 846 | return; |
836 | } | 847 | } |
@@ -852,7 +863,6 @@ run (void *cls, | |||
852 | //No address specified | 863 | //No address specified |
853 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 864 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
854 | "Don't know what to bind6 to...\n"); | 865 | "Don't know what to bind6 to...\n"); |
855 | GNUNET_free (addr_str); | ||
856 | GNUNET_SCHEDULER_shutdown (); | 866 | GNUNET_SCHEDULER_shutdown (); |
857 | return; | 867 | return; |
858 | } | 868 | } |
@@ -980,11 +990,6 @@ int | |||
980 | main (int argc, char *const *argv) | 990 | main (int argc, char *const *argv) |
981 | { | 991 | { |
982 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 992 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
983 | GNUNET_GETOPT_option_ulong ('p', | ||
984 | "port", | ||
985 | "PORT", | ||
986 | gettext_noop ("listen on specified port (default: 7776)"), | ||
987 | &port), | ||
988 | GNUNET_GETOPT_OPTION_END | 993 | GNUNET_GETOPT_OPTION_END |
989 | }; | 994 | }; |
990 | static const char* err_page = | 995 | static const char* err_page = |