<commit_before>/**
 * @file le_httpClientLib.c
 *
 * This file contains HTTP client specific interfaces.
 * le_httpClientLib is a thread-safe library that may be used in any Legato applications or
 * components.
 *
 * This library relies on callbacks to build a request and parse server response. The main advantage
 * of this implementation is to reduce memory usage: it allows to send chunks of the request instead
 * of storing and sending all at once.
 *
 * Check le_httpClientLib.h header for further details about usage and workflow.
 * <hr>
 *
 * Copyright (C) Sierra Wireless Inc.
 */
#include "legato.h"
#include "interfaces.h"

#include "le_httpClientLib.h"
#include "le_socketLib.h"
#include "http.h"

//--------------------------------------------------------------------------------------------------
// Symbol and Enum definitions
//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------
/**
 * Maximum length for credential.
 * Credential format is the following: "user:password"
 */
//--------------------------------------------------------------------------------------------------
#define CRED_MAX_LEN                256

//--------------------------------------------------------------------------------------------------
/**
 * Maximum number of HTTP sessions. Note that increasing this value increases memory consumption
 */
//--------------------------------------------------------------------------------------------------
#define HTTP_SESSIONS_NB            2

//--------------------------------------------------------------------------------------------------
/**
 * Memory pool parameters for tinyHTTP library.
 * For each HTTP session, a MEM_MAX buffer is allocated to store key/values in tinyHTTP library.
 */
//--------------------------------------------------------------------------------------------------
#define MEM_MAX                     512               // Block of memory that can be allocated
#define MEM_MAX_COUNT               HTTP_SESSIONS_NB  // Number of blocks to allocate

//--------------------------------------------------------------------------------------------------
/**<commit_msg>Enlarge mem pools to support 32 HTTPS connections<commit_after>/**
 * @file le_httpClientLib.c
 *
 * This file contains HTTP client specific interfaces.
 * le_httpClientLib is a thread-safe library that may be used in any Legato applications or
 * components.
 *
 * This library relies on callbacks to build a request and parse server response. The main advantage
 * of this implementation is to reduce memory usage: it allows to send chunks of the request instead
 * of storing and sending all at once.
 *
 * Check le_httpClientLib.h header for further details about usage and workflow.
 * <hr>
 *
 * Copyright (C) Sierra Wireless Inc.
 */
#include "legato.h"
#include "interfaces.h"

#include "le_httpClientLib.h"
#include "le_socketLib.h"
#include "http.h"

//--------------------------------------------------------------------------------------------------
// Symbol and Enum definitions
//--------------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------------
/**
 * Maximum length for credential.
 * Credential format is the following: "user:password"
 */
//--------------------------------------------------------------------------------------------------
#define CRED_MAX_LEN                256

//--------------------------------------------------------------------------------------------------
/**
 * Maximum number of HTTP sessions. Note that increasing this value increases memory consumption
 */
//--------------------------------------------------------------------------------------------------
#if MK_CONFIG_HTTP_MAX_SESSION_ID
#define HTTP_SESSIONS_NB            MK_CONFIG_HTTP_MAX_SESSION_ID
#else /* MK_CONFIG_HTTP_MAX_SESSION_ID */
#define HTTP_SESSIONS_NB            2
#endif


//--------------------------------------------------------------------------------------------------
/**
 * Memory pool parameters for tinyHTTP library.
 * For each HTTP session, a MEM_MAX buffer is allocated to store key/values in tinyHTTP library.
 */
//--------------------------------------------------------------------------------------------------
#define MEM_MAX                     512               // Block of memory that can be allocated
#define MEM_MAX_COUNT               HTTP_SESSIONS_NB  // Number of blocks to allocate

//--------------------------------------------------------------------------------------------------
/**
{'fraction_non_alphanumeric': 0.42202606137032367, 'fraction_numerical': 0.003362757461118117, 'mean_word_length': 0.8960159362549801, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1207941', 'n_tokens_mistral': 880, 'n_tokens_neox': 840, 'n_words': 341}