r_options.rec 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # *-* mode: rec -*-
  2. #
  3. # response option registry
  4. #
  5. %rec: R_Options
  6. # recutils supports only signed 32 bit values
  7. %typedef: enum_value range 1 0x7FFFFFFF
  8. %key: Name
  9. %singular: Value
  10. %type: Value enum_value
  11. %auto: Value
  12. %mandatory: Value
  13. %mandatory: Comment
  14. %allowed: Type Argument1 Description1 Member1 Argument2 Description2 Member2 Argument3 Description3 Member3
  15. %type: Name,Type,Argument1,Member1,Argument2,Member2,Argument3,Member3 line
  16. %unique: Type Value Argument1 Description1 Member1 Argument2 Description2 Member2 Argument3 Description3 Member3
  17. # General properties
  18. Name: REUSABLE
  19. Value: 20
  20. Type: enum MHD_Bool
  21. Comment: Make the response object re-usable. (FIXME: not used in struct ResponseOptions; remove!?)
  22. + The response will not be consumed by MHD_action_from_response() and must be destroyed by MHD_response_destroy().
  23. + Useful if the same response is often used to reply.
  24. # Content control
  25. Name: HEAD_ONLY_RESPONSE
  26. Value: 40
  27. Type: enum MHD_Bool
  28. Comment: Enable special processing of the response as body-less (with undefined body size). No automatic 'Content-Length' or 'Transfer-Encoding: chunked' headers are added when the response is used with #MHD_HTTP_STATUS_NOT_MODIFIED code or to respond to HEAD request.
  29. + The flag also allow to set arbitrary 'Content-Length' by #MHD_response_add_header() function.
  30. + This flag value can be used only with responses created without body (zero-size body).
  31. + Responses with this flag enabled cannot be used in situations where reply body must be sent to the client.
  32. + This flag is primarily intended to be used when automatic 'Content-Length' header is undesirable in response to HEAD requests.
  33. Name: CHUNKED_ENC
  34. Value: 41
  35. Type: enum MHD_Bool
  36. Comment: Force use of chunked encoding even if the response content size is known.
  37. + Ignored when the reply cannot have body/content.
  38. # Connection control
  39. Name: CONN_CLOSE
  40. Value: 60
  41. Type: enum MHD_Bool
  42. Comment: Force close connection after sending the response, prevents keep-alive connections and adds 'Connection: close' header.
  43. # Compatibility settings
  44. Name: HTTP_1_0_COMPATIBLE_STRICT
  45. Value: 80
  46. Type: enum MHD_Bool
  47. Comment: Only respond in conservative (dumb) HTTP/1.0-compatible mode.
  48. + Response still use HTTP/1.1 version in header, but always close the connection after sending the response and do not use chunked encoding for the response.
  49. + You can also set the #MHD_R_O_HTTP_1_0_SERVER flag to force HTTP/1.0 version in the response.
  50. + Responses are still compatible with HTTP/1.1.
  51. + Summary:
  52. + + declared reply version: HTTP/1.1
  53. + + keep-alive: no
  54. + + chunked: no
  55. +
  56. + This option can be used to communicate with some broken client, which does not implement HTTP/1.1 features, but advertises HTTP/1.1 support.
  57. Name: HTTP_1_0_SERVER
  58. Value: 81
  59. Type: enum MHD_Bool
  60. Comment: Only respond in HTTP/1.0-mode.
  61. + Contrary to the #MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT flag, the response's HTTP version will always be set to 1.0 and keep-alive connections will be used if explicitly requested by the client.
  62. + The 'Connection:' header will be added for both 'close' and 'keep-alive' connections.
  63. + Chunked encoding will not be used for the response.
  64. + Due to backward compatibility, responses still can be used with HTTP/1.1 clients.
  65. + This option can be used to emulate HTTP/1.0 server (for response part only as chunked encoding in requests (if any) is processed by MHD).
  66. + Summary:
  67. + + declared reply version: HTTP/1.0
  68. + + keep-alive: possible
  69. + + chunked: no
  70. +
  71. + With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
  72. # Violate HTTP and/or RFCs
  73. Name: INSANITY_HEADER_CONTENT_LENGTH
  74. Value: 100
  75. Type: enum MHD_Bool
  76. Comment: Disable sanity check preventing clients from manually setting the HTTP content length option.
  77. + Allow to set several 'Content-Length' headers. These headers will be used even with replies without body.
  78. # Callbacks
  79. Name: termination_callback
  80. Value: 121
  81. Type: struct MHD_ResponeOptionValueTermCB
  82. Comment: Set a function to be called once MHD is finished with the request.
  83. Argument1: MHD_RequestTerminationCallback term_cb
  84. Description1: the function to call,
  85. + NULL to not use the callback
  86. Argument2: void *term_cb_cls
  87. Description2: the closure for the callback