myMPD
Internal API documentation
Loading...
Searching...
No Matches
http_client_cache.c File Reference

HTTP client cache. More...

#include "compile_time.h"
#include "src/lib/http_client_cache.h"
#include "dist/mpack/mpack.h"
#include "src/lib/cache/cache_disk.h"
#include "src/lib/config_def.h"
#include "src/lib/filehandler.h"
#include "src/lib/http_client.h"
#include "src/lib/log.h"
#include "src/lib/mem.h"
#include "src/lib/mpack.h"
#include "src/lib/sds_extras.h"
#include <inttypes.h>
Include dependency graph for http_client_cache.c:

Functions

struct mg_client_response_thttp_client_cache_check (struct t_config *config, const char *uri)
 
struct mg_client_response_thttp_client_cache_read (const char *filepath)
 
bool http_client_cache_write (struct t_config *config, const char *uri, struct mg_client_response_t *mg_client_response)
 

Detailed Description

HTTP client cache.

Function Documentation

◆ http_client_cache_check()

struct mg_client_response_t * http_client_cache_check ( struct t_config config,
const char *  uri 
)

Checks the http client cache for uri

Parameters
configPointer to config
uriURI to check
Returns
struct mg_client_response_t* or NULL if not found

◆ http_client_cache_read()

struct mg_client_response_t * http_client_cache_read ( const char *  filepath)

Reads a response from the http client cache

Parameters
filepathCache filename
Returns
struct mg_client_response_t* or NULL on error

◆ http_client_cache_write()

bool http_client_cache_write ( struct t_config config,
const char *  uri,
struct mg_client_response_t mg_client_response 
)

Writes a http client cache file

Parameters
configPointer to config
uriURI to write the cache for
mg_client_responseThe http response to cache
Returns
true on success, else false