|
50 | 50 | #include "mgos_pppos.h"
|
51 | 51 | #endif
|
52 | 52 |
|
53 |
| -#define HTTP_URI_PREFIX "/rpc" |
54 |
| - |
55 | 53 | static struct mg_rpc *s_global_mg_rpc;
|
56 | 54 |
|
57 | 55 | extern const char *mg_build_id;
|
@@ -84,7 +82,7 @@ static void mgos_rpc_http_handler(struct mg_connection *nc, int ev,
|
84 | 82 | struct mg_rpc_channel *ch =
|
85 | 83 | mg_rpc_channel_http(nc, auth_domain, auth_file, &is_new);
|
86 | 84 | struct http_message *hm = (struct http_message *) ev_data;
|
87 |
| - size_t prefix_len = sizeof(HTTP_URI_PREFIX) - 1; |
| 85 | + size_t prefix_len = sizeof(MGOS_RPC_HTTP_URI_PREFIX) - 1; |
88 | 86 | if (ch == NULL) {
|
89 | 87 | mg_http_send_error(nc, 500, "Failed to create channel");
|
90 | 88 | return;
|
@@ -549,11 +547,12 @@ bool mgos_rpc_common_init(void) {
|
549 | 547 |
|
550 | 548 | #if defined(MGOS_HAVE_HTTP_SERVER) && MGOS_ENABLE_RPC_CHANNEL_HTTP
|
551 | 549 | if (mgos_sys_config_get_rpc_http_enable()) {
|
552 |
| - struct mg_http_endpoint_opts opts; |
553 |
| - memset(&opts, 0, sizeof(opts)); |
554 |
| - |
555 |
| - mgos_register_http_endpoint_opt(HTTP_URI_PREFIX, mgos_rpc_http_handler, |
556 |
| - opts); |
| 550 | + struct mg_http_endpoint_opts opts = { |
| 551 | + .auth_domain = NULL, |
| 552 | + .auth_file = NULL, |
| 553 | + }; |
| 554 | + mgos_register_http_endpoint_opt(MGOS_RPC_HTTP_URI_PREFIX, |
| 555 | + mgos_rpc_http_handler, opts); |
557 | 556 | }
|
558 | 557 | #endif
|
559 | 558 |
|
|
0 commit comments