Skip to content

Instantly share code, notes, and snippets.

@hintjens
Created May 20, 2013 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hintjens/5610778 to your computer and use it in GitHub Desktop.
Save hintjens/5610778 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "haywire.h"
#include "http_server.h"
#include "trie/radix.h"
#define CRLF "\r\n"
http_response *
http_response_new (void)
{
http_response *self = (http_response *) calloc (1, sizeof (http_response));
self->buffer = malloc (sizeof (char) * 1024);
return self;
}
void
http_response_destroy (http_response *self)
{
free (self->buffer);
free (self->body);
free (self);
}
int
http_response_set_header (http_response *self, char *key, void *value)
{
return rxt_put (key, value, (rxt_node *) self->headers);
}
int
http_response_send (http_response *self)
{
/* TODO */
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment