summaryrefslogtreecommitdiff
path: root/src/rest
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-04-29 08:06:44 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-04-29 08:06:44 +0200
commit60d45f936ee2e864b3c7f5c1fef7b83fab71ecd1 (patch)
tree7d2e80f805ebfbf8276ddbaa93e25659d709bd37 /src/rest
parentb648db0820be371cd4f782bb3ca1b6a80766980f (diff)
downloadgnunet-60d45f936ee2e864b3c7f5c1fef7b83fab71ecd1.tar.gz
gnunet-60d45f936ee2e864b3c7f5c1fef7b83fab71ecd1.zip
REST: trigger start; fix port
Diffstat (limited to 'src/rest')
-rw-r--r--src/rest/gnunet-rest-server.c23
-rw-r--r--src/rest/rest.conf4
2 files changed, 16 insertions, 11 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
980main (int argc, char *const *argv) 990main (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 =
diff --git a/src/rest/rest.conf b/src/rest/rest.conf
index 3674c3850..400db19a6 100644
--- a/src/rest/rest.conf
+++ b/src/rest/rest.conf
@@ -1,10 +1,10 @@
1[rest] 1[rest]
2UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-rest.sock 2UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-rest.sock
3BINARY=gnunet-rest-server 3BINARY=gnunet-rest-server
4IMMEDIATE_START=YES 4START_ON_DEMAND=YES
5BIND_TO=127.0.0.1 5BIND_TO=127.0.0.1
6BIND_TO6=::1 6BIND_TO6=::1
7REST_PORT=7776 7PORT=7776
8REST_ALLOW_HEADERS=Authorization,Accept,Content-Type 8REST_ALLOW_HEADERS=Authorization,Accept,Content-Type
9REST_ALLOW_ORIGIN=* 9REST_ALLOW_ORIGIN=*
10REST_ALLOW_CREDENTIALS=true 10REST_ALLOW_CREDENTIALS=true