diff --git a/core/subscription.c b/core/subscription.c index 1c9a3c3b..2e5ec358 100644 --- a/core/subscription.c +++ b/core/subscription.c @@ -310,6 +310,9 @@ struct uwsgi_subscribe_node *uwsgi_add_subscribe_node(struct uwsgi_subscribe_slo if ((usr->address_len > 0xff || usr->address_len == 0) && (usr->vassal_len > 0xff || usr->vassal_len == 0)) return NULL; + if (uwsgi.subscription_vassal_required && usr->vassal_len == 0) + return NULL; + if (current_slot) { #ifdef UWSGI_SSL if (uwsgi.subscriptions_sign_check_dir && !uwsgi_subscription_sign_check(current_slot, usr)) { diff --git a/core/uwsgi.c b/core/uwsgi.c index 9845f534..190b0fb9 100755 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -635,6 +635,7 @@ static struct uwsgi_option uwsgi_base_options[] = { {"subscription-notify-socket", required_argument, 0, "set the notification socket for subscriptions", uwsgi_opt_set_str, &uwsgi.subscription_notify_socket, UWSGI_OPT_MASTER}, {"subscription-mountpoints", required_argument, 0, "enable mountpoints support for subscription system", uwsgi_opt_set_int, &uwsgi.subscription_mountpoints, UWSGI_OPT_MASTER}, {"subscription-mountpoint", required_argument, 0, "enable mountpoints support for subscription system", uwsgi_opt_set_int, &uwsgi.subscription_mountpoints, UWSGI_OPT_MASTER}, + {"subscription-vassal-required", no_argument, 0, "require a vassal field for each subscription packet", uwsgi_opt_true, &uwsgi.subscription_vassal_required, UWSGI_OPT_MASTER}, #ifdef UWSGI_SSL {"legion", required_argument, 0, "became a member of a legion", uwsgi_opt_legion, NULL, UWSGI_OPT_MASTER}, diff --git a/uwsgi.h b/uwsgi.h index 0cd62307..0a16f58e 100755 --- a/uwsgi.h +++ b/uwsgi.h @@ -2813,6 +2813,7 @@ struct uwsgi_server { int emperor_command_socket_fd; int emperor_wait_for_command; struct uwsgi_string_list *emperor_wait_for_command_ignore; + int subscription_vassal_required; }; struct uwsgi_rpc {