libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

r_options.rec (4582B)


      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 
     18 # General properties
     19 
     20 Name: REUSABLE
     21 Value: 20
     22 Type: enum MHD_Bool
     23 Comment: Make the response object re-usable.
     24 + The response will not be consumed by MHD_action_from_response() and must be destroyed by MHD_response_destroy().
     25 + Useful if the same response is often used to reply.
     26 CustomSetter: /* custom setter */
     27 + if (response->reuse.reusable)
     28 + {
     29 +   if (MHD_NO == option->val.reusable)
     30 +   {
     31 +     res = MHD_SC_RESPONSE_CANNOT_CLEAR_REUSE;
     32 +     i = options_max_num - 1;
     33 +     break;
     34 +   }
     35 + }
     36 + else if ((MHD_NO != option->val.reusable) &&
     37 +          (! response_make_reusable(response)))
     38 + {
     39 +   res = MHD_SC_RESPONSE_MUTEX_INIT_FAILED;
     40 +   i = options_max_num - 1;
     41 +   break;
     42 + }
     43 
     44 # Content control
     45 
     46 Name: HEAD_ONLY_RESPONSE
     47 Value: 40
     48 Type: enum MHD_Bool
     49 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.
     50 + The flag also allow to set arbitrary 'Content-Length' by #MHD_response_add_header() function.
     51 + This flag value can be used only with responses created without body (zero-size body).
     52 + Responses with this flag enabled cannot be used in situations where reply body must be sent to the client.
     53 + This flag is primarily intended to be used when automatic 'Content-Length' header is undesirable in response to HEAD requests.
     54 
     55 Name: CHUNKED_ENC
     56 Value: 41
     57 Type: enum MHD_Bool
     58 Comment: Force use of chunked encoding even if the response content size is known.
     59 + Ignored when the reply cannot have body/content.
     60 
     61 # Connection control
     62 
     63 Name: CONN_CLOSE
     64 Value: 60
     65 Type: enum MHD_Bool
     66 Comment: Force close connection after sending the response, prevents keep-alive connections and adds 'Connection: close' header.
     67 
     68 # Compatibility settings
     69 
     70 Name: HTTP_1_0_COMPATIBLE_STRICT
     71 Value: 80
     72 Type: enum MHD_Bool
     73 Comment: Only respond in conservative (dumb) HTTP/1.0-compatible mode.
     74 + 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.
     75 + You can also set the #MHD_R_O_HTTP_1_0_SERVER flag to force HTTP/1.0 version in the response.
     76 + Responses are still compatible with HTTP/1.1.
     77 + Summary:
     78 + + declared reply version: HTTP/1.1
     79 + + keep-alive: no
     80 + + chunked: no
     81 +
     82 + 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.
     83 
     84 Name: HTTP_1_0_SERVER
     85 Value: 81
     86 Type: enum MHD_Bool
     87 Comment: Only respond in HTTP/1.0-mode.
     88 + 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.
     89 + The 'Connection:' header will be added for both 'close' and 'keep-alive' connections.
     90 + Chunked encoding will not be used for the response.
     91 + Due to backward compatibility, responses still can be used with HTTP/1.1 clients.
     92 + 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).
     93 + Summary:
     94 + + declared reply version: HTTP/1.0
     95 + + keep-alive: possible
     96 + + chunked: no
     97 +
     98 + With this option HTTP/1.0 server is emulated (with support for 'keep-alive' connections).
     99 
    100 # Violate HTTP and/or RFCs
    101 
    102 Name: INSANITY_HEADER_CONTENT_LENGTH
    103 Value: 100
    104 Type: enum MHD_Bool
    105 Comment: Disable sanity check preventing clients from manually setting the HTTP content length option.
    106 + Allow to set several 'Content-Length' headers. These headers will be used even with replies without body.
    107 
    108 # Callbacks
    109 
    110 Name: termination_callback
    111 Value: 121
    112 Type: struct MHD_ResponseOptionValueEndedCB
    113 Comment: Set a function to be called once MHD is finished with the request.
    114 Argument1: MHD_RequestEndedCallback ended_cb
    115 Description1: the function to call,
    116 + NULL to not use the callback
    117 Argument2: void *ended_cb_cls
    118 Description2: the closure for the callback