Adding base for async with kong

This commit is contained in:
Granyaa
2026-01-14 11:55:00 +02:00
parent 5dfa150635
commit 175429e60b
9 changed files with 926 additions and 1 deletions

View File

@@ -40,6 +40,15 @@ void FiniNanoAttachment(NanoAttachment *attachment);
NanoCommunicationResult RestartAttachmentConfiguration(NanoAttachment *attachment);
///
/// @brief Retrieves the communication socket from a NanoAttachment.
///
/// @param attachment A pointer to the NanoAttachment structure.
///
/// @return The communication socket file descriptor, or -1 if attachment is NULL.
///
int GetCommSocket(NanoAttachment *attachment);
///
/// @brief Initializes a HttpSessionData structure with default values.
///
@@ -100,6 +109,19 @@ void SendAccumulatedMetricData(NanoAttachment *attachment);
///
AttachmentVerdictResponse SendDataNanoAttachment(NanoAttachment *attachment, AttachmentData *data);
///
/// @brief Sends attachment data asynchronously to the appropriate handlers.
///
/// This function processes the attachment data based on its chunk type and sends
/// it to the appropriate async handler functions.
///
/// @param attachment A pointer to the NanoAttachment structure associated with the data.
/// @param data A pointer to the AttachmentData structure containing the data to be processed.
///
/// @return A NanoCommunicationResult indicating the success or failure of the operation.
///
NanoCommunicationResult SendDataNanoAttachmentAsync(NanoAttachment *attachment, AttachmentData *data);
///
/// @brief Sends a keep-alive signal using a socket connection.
///
@@ -266,4 +288,32 @@ freeCompressedBody(
NanoHttpBody *bodies
);
///
/// @brief Checks if the queue is empty.
///
/// @param attachment A pointer to the NanoAttachment structure.
///
/// @return Returns true if the queue is empty, false otherwise.
///
bool isQueueEmpty(NanoAttachment *attachment);
///
/// @brief Pops a session ID from the queue and updates the table.
///
/// @param attachment A pointer to the NanoAttachment structure.
///
/// @return The session ID that was popped from the queue.
///
SessionID PopFromQueue(NanoAttachment *attachment);
///
/// @brief Retrieves a verdict response for a given session ID from the table.
///
/// @param attachment A pointer to the NanoAttachment structure.
/// @param session_id The session ID to look up.
///
/// @return An AttachmentVerdictResponse structure containing the verdict for the session.
///
AttachmentVerdictResponse getAttachmentVerdictResponse(NanoAttachment *attachment, SessionID session_id);
#endif // __NANO_ATTACHMENT_H__