Exchange

Types and functions to for individual exchanges (request/response pairs).

Types

struct ymo_wsgi_exchange

Type used to store request/response pairs as an exchange.

Definition
struct ymo_wsgi_exchange {
    ymo_wsgi_session_t*       session;
    ymo_http_request_t*       request;
    ymo_http_response_t*      response;
    ymo_bucket_t*             body_data;
    struct ymo_wsgi_exchange* next;
    int                       done;
    int                       sent;
    int                       no_pool;   /* Gross */
    size_t                    body_read;
    atomic_int_least16_t      refcnt;
};
struct ymo_wsgi_exchange_pool

Pool of preallocated exchange objects for resuse.

Definition
struct ymo_wsgi_exchange_pool {
    ymo_wsgi_exchange_t* head;
    ymo_wsgi_exchange_t  items[YMO_WSGI_EXCHANGE_POOL_SIZE];
};

Functions

ymo_wsgi_exchange_t *ymo_wsgi_exchange_create(void)

Create a new WSGI exchange to encapsulate a request/response pair for the given session.

void ymo_wsgi_exchange_free(ymo_wsgi_session_t *session, ymo_wsgi_exchange_t *exchange)

Release a WSGI exchange.

size_t ymo_wsgi_exchange_incref(ymo_wsgi_exchange_t *exchange)
size_t ymo_wsgi_exchange_decref(ymo_wsgi_exchange_t *exchange)