Exchange ==================== Types and functions to for individual exchanges (request/response pairs). --------------------------------- Types --------------------------------- .. c:struct:: ymo_wsgi_exchange Type used to store request/response pairs as an exchange. .. code-block:: c :caption: 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; }; .. c:struct:: ymo_wsgi_exchange_pool Pool of preallocated exchange objects for resuse. .. code-block:: c :caption: Definition struct ymo_wsgi_exchange_pool { ymo_wsgi_exchange_t* head; ymo_wsgi_exchange_t items[YMO_WSGI_EXCHANGE_POOL_SIZE]; }; --------------------------------- Functions --------------------------------- .. c:function:: ymo_wsgi_exchange_t* ymo_wsgi_exchange_create(void) Create a new WSGI exchange to encapsulate a request/response pair for the given session. .. c:function:: void ymo_wsgi_exchange_free( ymo_wsgi_session_t* session, ymo_wsgi_exchange_t* exchange) Release a WSGI exchange. .. c:function:: size_t ymo_wsgi_exchange_incref(ymo_wsgi_exchange_t* exchange) .. c:function:: size_t ymo_wsgi_exchange_decref(ymo_wsgi_exchange_t* exchange)