request.c
496 Bytes
#include <stdlib.h>
#include "class.h"
#include "http/request.h"
static
void
_free(void ** data)
{
if (NULL != *data) {
free(*data);
}
}
static
void
dtor(void * _this)
{
int i;
_free(&(this->http_version));
_free(&(this->uri));
_free(&(this->method));
for (i=0; i<128; i++) {
_free(&((this->header)[i].name));
_free(&((this->header)[i].value));
}
_free(&(this->body));
}
INIT_IFACE(Class, NULL, dtor, NULL);
CREATE_CLASS(HttpRequest, IFACE(Class));
// vim: set ts=4 sw=4: