r_options.rec 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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.
  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. + 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.
  52. Name: HTTP_1_0_SERVER
  53. Value: 81
  54. Type: enum MHD_Bool
  55. Comment: Only respond in HTTP/1.0-mode.
  56. + 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.
  57. + The "Connection:" header will be added for both "close" and "keep-alive" connections.
  58. + Chunked encoding will not be used for the response.
  59. + Due to backward compatibility, responses still can be used with HTTP/1.1 clients.
  60. + 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).
  61. + With this option HTTP/1.0 server is emulated (with support for "keep-alive" connections).
  62. # Violate HTTP and/or RFCs
  63. Name: INSANITY_HEADER_CONTENT_LENGTH
  64. Value: 100
  65. Type: enum MHD_Bool
  66. Comment: Disable sanity check preventing clients from manually setting the HTTP content length option.
  67. + Allow to set several "Content-Length" headers. These headers will be used even with replies without body.
  68. # Callbacks
  69. Name: termination_callback
  70. Value: 121
  71. Type: struct MHD_ResponeOptionValueTermCB
  72. Comment: Set a function to be called once MHD is finished with the request.
  73. Argument1: MHD_RequestTerminationCallback term_cb
  74. Description1: the function to call,
  75. + NULL to not use the callback
  76. Argument2: void *term_cb_cls
  77. Description2: the closure for the callback