mirror of
https://github.com/openappsec/attachment.git
synced 2026-01-17 16:00:26 +03:00
sync code
This commit is contained in:
@@ -606,21 +606,21 @@ FreeAttachmentResponseContent(
|
||||
return;
|
||||
}
|
||||
|
||||
HttpBody *
|
||||
compressBody(NanoAttachment *attachment, HttpSessionData *session_data, HttpBody *bodies)
|
||||
NanoHttpBody *
|
||||
compressBody(NanoAttachment *attachment, HttpSessionData *session_data, NanoHttpBody *bodies)
|
||||
{
|
||||
return nano_compress_body(attachment, bodies, session_data);
|
||||
}
|
||||
|
||||
|
||||
HttpBody *
|
||||
decompressBody(NanoAttachment *attachment, HttpSessionData *session_data, HttpBody *bodies)
|
||||
NanoHttpBody *
|
||||
decompressBody(NanoAttachment *attachment, HttpSessionData *session_data, NanoHttpBody *bodies)
|
||||
{
|
||||
return nano_decompress_body(attachment, bodies, session_data);
|
||||
}
|
||||
|
||||
void
|
||||
freeCompressedBody(NanoAttachment *attachment, HttpSessionData *session_data, HttpBody *bodies)
|
||||
freeCompressedBody(NanoAttachment *attachment, HttpSessionData *session_data, NanoHttpBody *bodies)
|
||||
{
|
||||
nano_free_compressed_body(attachment, bodies, session_data);
|
||||
}
|
||||
|
||||
@@ -1560,7 +1560,7 @@ nano_header_sender(
|
||||
void
|
||||
nano_body_sender(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpEventThreadCtx *ctx,
|
||||
AttachmentDataType body_type,
|
||||
uint32_t cur_request_id,
|
||||
|
||||
@@ -168,7 +168,7 @@ nano_header_sender(
|
||||
/// of messages sent.
|
||||
///
|
||||
/// @param attachment Pointer to a NanoAttachment struct representing the attachment/module.
|
||||
/// @param bodies Pointer to an HttpBody struct containing the HTTP request/response body data.
|
||||
/// @param bodies Pointer to an NanoHttpBody struct containing the HTTP request/response body data.
|
||||
/// @param ctx Pointer to an HttpEventThreadCtx struct representing the HTTP event thread context.
|
||||
/// @param body_type Enum value indicating whether the body is a request or response body.
|
||||
/// @param cur_request_id Current request ID for logging and tracking purposes.
|
||||
@@ -177,7 +177,7 @@ nano_header_sender(
|
||||
void
|
||||
nano_body_sender(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpEventThreadCtx *ctx,
|
||||
AttachmentDataType body_type,
|
||||
uint32_t cur_request_id,
|
||||
|
||||
@@ -229,7 +229,7 @@ void *
|
||||
SendRequestBodyThread(void *_ctx)
|
||||
{
|
||||
HttpEventThreadCtx *ctx = (HttpEventThreadCtx *)_ctx;
|
||||
HttpBody *bodies = (HttpBody*)ctx->data->data;
|
||||
NanoHttpBody *bodies = (NanoHttpBody*)ctx->data->data;
|
||||
NanoAttachment *attachment = ctx->attachment;
|
||||
HttpSessionData *session_data_p = ctx->session_data_p;
|
||||
|
||||
@@ -249,7 +249,7 @@ void *
|
||||
SendResponseBodyThread(void *_ctx)
|
||||
{
|
||||
HttpEventThreadCtx *ctx = (HttpEventThreadCtx *)_ctx;
|
||||
HttpBody *bodies = (HttpBody*)ctx->data->data;
|
||||
NanoHttpBody *bodies = (NanoHttpBody*)ctx->data->data;
|
||||
NanoAttachment *attachment = ctx->attachment;
|
||||
HttpSessionData *session_data_p = ctx->session_data_p;
|
||||
|
||||
|
||||
@@ -261,3 +261,9 @@ isSkipSource(c_str ip_str)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
isPairedAffinityEnabled()
|
||||
{
|
||||
return conf_data.getNumericalValue("is_paired_affinity_enabled");
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
#include "compression_utils.h"
|
||||
#include "nano_utils.h"
|
||||
|
||||
HttpBody *
|
||||
NanoHttpBody *
|
||||
nano_compress_body(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpSessionData *session_data_p
|
||||
)
|
||||
{
|
||||
CompressionResult compression_result;
|
||||
HttpBody *compressed_body;
|
||||
NanoHttpBody *compressed_body;
|
||||
size_t i;
|
||||
|
||||
if (session_data_p->response_data.compression_type == NO_COMPRESSION) {
|
||||
@@ -32,7 +32,7 @@ nano_compress_body(
|
||||
session_data_p->response_data.compression_stream = initCompressionStream();
|
||||
}
|
||||
|
||||
compressed_body = malloc(sizeof(HttpBody));
|
||||
compressed_body = malloc(sizeof(NanoHttpBody));
|
||||
if (compressed_body == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -59,15 +59,15 @@ nano_compress_body(
|
||||
return compressed_body;
|
||||
}
|
||||
|
||||
HttpBody *
|
||||
NanoHttpBody *
|
||||
nano_decompress_body(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpSessionData *session_data_p
|
||||
)
|
||||
{
|
||||
DecompressionResult decompression_result;
|
||||
HttpBody *decompressed_body;
|
||||
NanoHttpBody *decompressed_body;
|
||||
size_t i;
|
||||
|
||||
if (session_data_p->response_data.compression_type == NO_COMPRESSION) {
|
||||
@@ -84,7 +84,7 @@ nano_decompress_body(
|
||||
session_data_p->response_data.decompression_stream = initCompressionStream();
|
||||
}
|
||||
|
||||
decompressed_body = malloc(sizeof(HttpBody));
|
||||
decompressed_body = malloc(sizeof(NanoHttpBody));
|
||||
if (decompressed_body == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ nano_decompress_body(
|
||||
void
|
||||
nano_free_compressed_body(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpSessionData *session_data_p
|
||||
)
|
||||
{
|
||||
|
||||
@@ -6,39 +6,39 @@
|
||||
/// @brief Compresses the given HTTP body using the specified compression type in the session data.
|
||||
///
|
||||
/// @param attachment Pointer to the NanoAttachment structure.
|
||||
/// @param bodies Pointer to the HttpBody structure containing the data to be compressed.
|
||||
/// @param bodies Pointer to the NanoHttpBody structure containing the data to be compressed.
|
||||
/// @param session_data_p Pointer to the HttpSessionData structure containing session-specific data.
|
||||
///
|
||||
/// @return Pointer to a new HttpBody structure containing the compressed data,
|
||||
/// @return Pointer to a new NanoHttpBody structure containing the compressed data,
|
||||
/// or NULL if compression is not needed or fails.
|
||||
HttpBody *nano_compress_body(
|
||||
NanoHttpBody *nano_compress_body(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpSessionData *session_data_p
|
||||
);
|
||||
|
||||
/// @brief Decompresses the given HTTP body using the specified compression type in the session data.
|
||||
///
|
||||
/// @param attachment Pointer to the NanoAttachment structure.
|
||||
/// @param bodies Pointer to the HttpBody structure containing the data to be decompressed.
|
||||
/// @param bodies Pointer to the NanoHttpBody structure containing the data to be decompressed.
|
||||
/// @param session_data_p Pointer to the HttpSessionData structure containing session-specific data.
|
||||
///
|
||||
/// @return Pointer to a new HttpBody structure containing the decompressed data,
|
||||
/// @return Pointer to a new NanoHttpBody structure containing the decompressed data,
|
||||
/// or NULL if decompression is not needed or fails.
|
||||
HttpBody *nano_decompress_body(
|
||||
NanoHttpBody *nano_decompress_body(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpSessionData *session_data_p
|
||||
);
|
||||
|
||||
/// @brief Frees the memory allocated for the compressed HTTP body.
|
||||
///
|
||||
/// @param attachment Pointer to the NanoAttachment structure.
|
||||
/// @param bodies Pointer to the HttpBody structure containing the compressed data to be freed.
|
||||
/// @param bodies Pointer to the NanoHttpBody structure containing the compressed data to be freed.
|
||||
/// @param session_data_p Pointer to the HttpSessionData structure containing session-specific data.
|
||||
void nano_free_compressed_body(
|
||||
NanoAttachment *attachment,
|
||||
HttpBody *bodies,
|
||||
NanoHttpBody *bodies,
|
||||
HttpSessionData *session_data_p
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user