Repository: envoyproxy/envoy
File: source/extensions/dynamic_modules/abi.h (C/C++)

Code before:
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.
 * @param status_code is the status code of the response.
 * @param headers_vector is the array of envoy_dynamic_module_type_module_http_header that contains
 * the headers of the response.
 * @param headers_vector_size is the size of the headers_vector.
 * @param body is the pointer to the buffer of the body of the response.
 * @param body_length is the length of the body.
 */
void envoy_dynamic_module_callback_http_send_response(
    envoy_dynamic_module_type_http_filter_envoy_ptr filter_envoy_ptr, uint32_t status_code,
    envoy_dynamic_module_type_module_http_header* headers_vector, size_t headers_vector_size,
    envoy_dynamic_module_type_buffer_module_ptr body, size_t body_length);

/**
 * envoy_dynamic_module_callback_http_send_response_headers is called by the module to send the
 * response headers to the downstream, optionally ending the stream.
 *
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.
 * @param headers_vector is the array of envoy_dynamic_module_type_module_http_header that contains
 * the headers of the response.
 * @param headers_vector_size is the size of the headers_vector.
 * @param end_stream is a boolean indicating whether to end the stream.
 */
void envoy_dynamic_module_callback_http_send_response_headers(
    envoy_dynamic_module_type_http_filter_envoy_ptr filter_envoy_ptr,
    envoy_dynamic_module_type_module_http_header* headers_vector, size_t headers_vector_size,
    bool end_stream);

/**
 * envoy_dynamic_module_callback_http_send_response is called by the module to send response
 * data to the downstream, optionally ending the stream.
 *
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.
 * @param body is the pointer to the buffer of the body of the response.
 * @param body_length is the length of the body.
 * @param end_stream is a boolean indicating whether to end the stream.
 */
void envoy_dynamic_module_callback_http_send_response_data(
    envoy_dynamic_module_type_http_filter_envoy_ptr filter_envoy_ptr,
    envoy_dynamic_module_type_buffer_module_ptr data, size_t length, bool end_stream);

/**
 * envoy_dynamic_module_callback_http_send_response_headers is called by the module to send the
 * response trailers to the downstream, ending the stream.
 *
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.
 * @param trailers_vector is the array of envoy_dynamic_module_type_module_http_header that contains

Review comment (suggestion):
"Necessary pseudo headers such as :status should be present." This should be documented in abi.h as well

Code after:
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.
 * @param status_code is the status code of the response.
 * @param headers_vector is the array of envoy_dynamic_module_type_module_http_header that contains
 * the headers of the response.
 * @param headers_vector_size is the size of the headers_vector.
 * @param body is the pointer to the buffer of the body of the response.
 * @param body_length is the length of the body.
 */
void envoy_dynamic_module_callback_http_send_response(
    envoy_dynamic_module_type_http_filter_envoy_ptr filter_envoy_ptr, uint32_t status_code,
    envoy_dynamic_module_type_module_http_header* headers_vector, size_t headers_vector_size,
    envoy_dynamic_module_type_buffer_module_ptr body, size_t body_length);

/**
 * envoy_dynamic_module_callback_http_send_response_headers is called by the module to send the
 * response headers to the downstream, optionally ending the stream. Necessary pseudo headers
 * such as :status should be present.
 *
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.
 * @param headers_vector is the array of envoy_dynamic_module_type_module_http_header that contains
 * the headers of the response.
 * @param headers_vector_size is the size of the headers_vector.
 * @param end_stream is a boolean indicating whether to end the stream.
 */
void envoy_dynamic_module_callback_http_send_response_headers(
    envoy_dynamic_module_type_http_filter_envoy_ptr filter_envoy_ptr,
    envoy_dynamic_module_type_module_http_header* headers_vector, size_t headers_vector_size,
    bool end_stream);

/**
 * envoy_dynamic_module_callback_http_send_response is called by the module to send response
 * data to the downstream, optionally ending the stream.
 *
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.
 * @param body is the pointer to the buffer of the body of the response.
 * @param body_length is the length of the body.
 * @param end_stream is a boolean indicating whether to end the stream.
 */
void envoy_dynamic_module_callback_http_send_response_data(
    envoy_dynamic_module_type_http_filter_envoy_ptr filter_envoy_ptr,
    envoy_dynamic_module_type_buffer_module_ptr data, size_t length, bool end_stream);

/**
 * envoy_dynamic_module_callback_http_send_response_headers is called by the module to send the
 * response trailers to the downstream, ending the stream.
 *
 * @param filter_envoy_ptr is the pointer to the DynamicModuleHttpFilter object of the
 * corresponding HTTP filter.