mUPnP for C
http_persistent_connection.c File Reference
#include <mupnp/http/http.h>
#include <mupnp/net/socket.h>
#include <mupnp/util/list.h>
#include <mupnp/util/log.h>
#include <mupnp/util/mutex.h>
#include <mupnp/util/time.h>

Data Structures

struct  _mUpnpHttpPersistentConnection
 

Macros

#define MUPNP_HTTP_PERSISTENT_CACHE_SIZE   5
 
#define MUPNP_HTTP_PERSISTENT_TIMEOUT_PERIOD   60
 

Typedefs

typedef struct _mUpnpHttpPersistentConnection mUpnpHttpPersistentConnection
 
typedef struct _mUpnpHttpPersistentConnection mUpnpHttpPersistentConnectionList
 

Functions

bool mupnp_http_persistentconnection_init (void)
 
mUpnpHttpPersistentConnectionmupnp_http_persistentconnection_new (void)
 
void mupnp_http_persistentconnection_delete (mUpnpHttpPersistentConnection *node)
 
void * mupnp_http_persistentconnection_get (char *host, int port)
 
bool mupnp_http_persistentconnection_put (char *host, int port, void *data)
 
void mupnp_http_persistentconnection_clear (void)
 
void mupnp_http_persistentconnection_lock (void)
 
void mupnp_http_persistentconnection_unlock (void)
 

Variables

static mUpnpHttpPersistentConnectionListcache = NULL
 
static mUpnpMutexpersistent_connection_mutex = NULL
 

Macro Definition Documentation

◆ MUPNP_HTTP_PERSISTENT_CACHE_SIZE

#define MUPNP_HTTP_PERSISTENT_CACHE_SIZE   5

◆ MUPNP_HTTP_PERSISTENT_TIMEOUT_PERIOD

#define MUPNP_HTTP_PERSISTENT_TIMEOUT_PERIOD   60

Typedef Documentation

◆ mUpnpHttpPersistentConnection

◆ mUpnpHttpPersistentConnectionList

Function Documentation

◆ mupnp_http_persistentconnection_clear()

void mupnp_http_persistentconnection_clear ( void )

Clear persistent connection cache and free all memory

◆ mupnp_http_persistentconnection_delete()

void mupnp_http_persistentconnection_delete ( mUpnpHttpPersistentConnection * node)

◆ mupnp_http_persistentconnection_get()

void * mupnp_http_persistentconnection_get ( char * host,
int port )

Get persistent connection from cache

◆ mupnp_http_persistentconnection_init()

bool mupnp_http_persistentconnection_init ( void )

Initialize persistent connection cache. Can be called many times

◆ mupnp_http_persistentconnection_lock()

void mupnp_http_persistentconnection_lock ( void )

Lock persistent connection cache. Required for getting, putting and using persistent connection from cache

◆ mupnp_http_persistentconnection_new()

mUpnpHttpPersistentConnection * mupnp_http_persistentconnection_new ( void )

◆ mupnp_http_persistentconnection_put()

bool mupnp_http_persistentconnection_put ( char * host,
int port,
void * data )

Put connection to persistent connection cache

◆ mupnp_http_persistentconnection_unlock()

void mupnp_http_persistentconnection_unlock ( void )

Unlock persistent connection cache.

Variable Documentation

◆ cache

mUpnpHttpPersistentConnectionList* cache = NULL
static

◆ persistent_connection_mutex

mUpnpMutex* persistent_connection_mutex = NULL
static