emqx_stomp.hrl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2020-2021 EMQ Technologies Co., Ltd. All Rights Reserved.
  3. %%
  4. %% Licensed under the Apache License, Version 2.0 (the "License");
  5. %% you may not use this file except in compliance with the License.
  6. %% You may obtain a copy of the License at
  7. %%
  8. %% http://www.apache.org/licenses/LICENSE-2.0
  9. %%
  10. %% Unless required by applicable law or agreed to in writing, software
  11. %% distributed under the License is distributed on an "AS IS" BASIS,
  12. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. %% See the License for the specific language governing permissions and
  14. %% limitations under the License.
  15. %%--------------------------------------------------------------------
  16. %% @doc Stomp Frame Header.
  17. -define(STOMP_VER, <<"1.2">>).
  18. -define(STOMP_SERVER, <<"emqx-stomp/1.2">>).
  19. %%--------------------------------------------------------------------
  20. %% STOMP Frame
  21. %%--------------------------------------------------------------------
  22. -record(stomp_frame, {command, headers = [], body = <<>> :: iodata()}).
  23. -type(stomp_frame() :: #stomp_frame{}).
  24. %%--------------------------------------------------------------------
  25. %% Frame Size Limits
  26. %%
  27. %% To prevent malicious clients from exploiting memory allocation in a server,
  28. %% servers MAY place maximum limits on:
  29. %%
  30. %% the number of frame headers allowed in a single frame
  31. %% the maximum length of header lines
  32. %% the maximum size of a frame body
  33. %%
  34. %% If these limits are exceeded the server SHOULD send the client an ERROR frame
  35. %% and then close the connection.
  36. %%--------------------------------------------------------------------
  37. -define(MAX_HEADER_NUM, 10).
  38. -define(MAX_HEADER_LENGTH, 1024).
  39. -define(MAX_BODY_LENGTH, 65536).