Skip to content

Commit 75cee2c

Browse files
committed
Use MAX_SUPPORTED_PRIORITY constant for argument validation
Part of #1590.
1 parent 9f9a414 commit 75cee2c

File tree

3 files changed

+152
-3
lines changed

3 files changed

+152
-3
lines changed

src/rabbit_amqqueue.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,9 @@ check_message_ttl_arg({Type, Val}, Args) ->
613613

614614
check_max_priority_arg({Type, Val}, Args) ->
615615
case check_non_neg_int_arg({Type, Val}, Args) of
616-
ok when Val =< 255 -> ok;
617-
ok -> {error, {max_value_exceeded, Val}};
618-
Error -> Error
616+
ok when Val =< ?MAX_SUPPORTED_PRIORITY -> ok;
617+
ok -> {error, {max_value_exceeded, Val}};
618+
Error -> Error
619619
end.
620620

621621
%% Note that the validity of x-dead-letter-exchange is already verified

src/rabbit_ctl_usage.erl

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
%% Generated, do not edit!
2+
-module(rabbit_ctl_usage).
3+
-export([usage/0]).
4+
usage() -> "Usage:
5+
rabbitmqctl [-n <node>] [-t <timeout>] [-q] <command> [<command options>]
6+
7+
Options:
8+
-n node
9+
-q
10+
-t timeout
11+
12+
Default node is \"rabbit@server\", where server is the local host. On a host
13+
named \"server.example.com\", the node name of the RabbitMQ Erlang node will
14+
usually be rabbit@server (unless RABBITMQ_NODENAME has been set to some
15+
non-default value at broker startup time). The output of hostname -s is usually
16+
the correct suffix to use after the \"@\" sign. See rabbitmq-server(1) for
17+
details of configuring the RabbitMQ broker.
18+
19+
Quiet output mode is selected with the \"-q\" flag. Informational messages are
20+
suppressed when quiet mode is in effect.
21+
22+
Operation timeout in seconds. Only applicable to \"list\" commands. Default is
23+
\"infinity\".
24+
25+
Commands:
26+
stop [<pid_file>]
27+
shutdown
28+
stop_app
29+
start_app
30+
wait <pid_file>
31+
reset
32+
force_reset
33+
rotate_logs <suffix>
34+
hipe_compile <directory>
35+
36+
join_cluster <clusternode> [--ram]
37+
cluster_status
38+
change_cluster_node_type disc | ram
39+
forget_cluster_node [--offline]
40+
rename_cluster_node oldnode1 newnode1 [oldnode2] [newnode2 ...]
41+
update_cluster_nodes clusternode
42+
force_boot
43+
sync_queue [-p <vhost>] queue
44+
cancel_sync_queue [-p <vhost>] queue
45+
purge_queue [-p <vhost>] queue
46+
set_cluster_name name
47+
48+
add_user <username> <password>
49+
delete_user <username>
50+
change_password <username> <newpassword>
51+
clear_password <username>
52+
authenticate_user <username> <password>
53+
set_user_tags <username> <tag> ...
54+
list_users
55+
56+
add_vhost <vhost>
57+
delete_vhost <vhost>
58+
list_vhosts [<vhostinfoitem> ...]
59+
set_permissions [-p <vhost>] <user> <conf> <write> <read>
60+
clear_permissions [-p <vhost>] <username>
61+
list_permissions [-p <vhost>]
62+
list_user_permissions <username>
63+
64+
set_parameter [-p <vhost>] <component_name> <name> <value>
65+
clear_parameter [-p <vhost>] <component_name> <key>
66+
list_parameters [-p <vhost>]
67+
set_global_parameter <name> <value>
68+
clear_global_parameter <name>
69+
list_global_parameters
70+
71+
set_policy [-p <vhost>] [--priority <priority>] [--apply-to <apply-to>]
72+
<name> <pattern> <definition>
73+
clear_policy [-p <vhost>] <name>
74+
list_policies [-p <vhost>]
75+
76+
list_queues [-p <vhost>] [--offline|--online|--local] [<queueinfoitem> ...]
77+
list_exchanges [-p <vhost>] [<exchangeinfoitem> ...]
78+
list_bindings [-p <vhost>] [<bindinginfoitem> ...]
79+
list_connections [<connectioninfoitem> ...]
80+
list_channels [<channelinfoitem> ...]
81+
list_consumers [-p <vhost>]
82+
status
83+
node_health_check
84+
environment
85+
report
86+
eval <expr>
87+
88+
close_connection <connectionpid> <explanation>
89+
trace_on [-p <vhost>]
90+
trace_off [-p <vhost>]
91+
set_vm_memory_high_watermark <fraction>
92+
set_vm_memory_high_watermark absolute <memory_limit>
93+
set_disk_free_limit <disk_limit>
94+
set_disk_free_limit mem_relative <fraction>
95+
encode [--decode] [<value>] [<passphrase>] [--list-ciphers] [--list-hashes]
96+
[--cipher <cipher>] [--hash <hash>] [--iterations <iterations>]
97+
decode [<value>] [<passphrase>][--cipher <cipher>] [--hash <hash>]
98+
[--iterations <iterations>]
99+
list_hashes
100+
list_ciphers
101+
102+
<vhostinfoitem> must be a member of the list [name, tracing].
103+
104+
The list_queues, list_exchanges and list_bindings commands accept an optional
105+
virtual host parameter for which to display results. The default value is \"/\".
106+
107+
<queueinfoitem> must be a member of the list [name, durable, auto_delete,
108+
arguments, policy, pid, owner_pid, exclusive, exclusive_consumer_pid,
109+
exclusive_consumer_tag, messages_ready, messages_unacknowledged, messages,
110+
messages_ready_ram, messages_unacknowledged_ram, messages_ram,
111+
messages_persistent, message_bytes, message_bytes_ready,
112+
message_bytes_unacknowledged, message_bytes_ram, message_bytes_persistent,
113+
head_message_timestamp, disk_reads, disk_writes, consumers,
114+
consumer_utilisation, memory, slave_pids, synchronised_slave_pids, state].
115+
116+
<exchangeinfoitem> must be a member of the list [name, type, durable,
117+
auto_delete, internal, arguments, policy].
118+
119+
<bindinginfoitem> must be a member of the list [source_name, source_kind,
120+
destination_name, destination_kind, routing_key, arguments].
121+
122+
<connectioninfoitem> must be a member of the list [pid, name, port, host,
123+
peer_port, peer_host, ssl, ssl_protocol, ssl_key_exchange, ssl_cipher,
124+
ssl_hash, peer_cert_subject, peer_cert_issuer, peer_cert_validity, state,
125+
channels, protocol, auth_mechanism, user, vhost, timeout, frame_max,
126+
channel_max, client_properties, recv_oct, recv_cnt, send_oct, send_cnt,
127+
send_pend, connected_at].
128+
129+
<channelinfoitem> must be a member of the list [pid, connection, name, number,
130+
user, vhost, transactional, confirm, consumer_count, messages_unacknowledged,
131+
messages_uncommitted, acks_uncommitted, messages_unconfirmed, prefetch_count,
132+
global_prefetch_count].
133+
134+
135+
".

src/rabbit_plugins_usage.erl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
%% Generated, do not edit!
2+
-module(rabbit_plugins_usage).
3+
-export([usage/0]).
4+
usage() -> "Usage:
5+
rabbitmq-plugins [-n <node>] <command> [<command options>]
6+
7+
Commands:
8+
list [-v] [-m] [-E] [-e] [<pattern>]
9+
enable [--offline] [--online] <plugin> ...
10+
disable [--offline] [--online] <plugin> ...
11+
set [--offline] [--online] <plugin> ...
12+
13+
14+
".

0 commit comments

Comments
 (0)