Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
692 B

/* See LICENSE file for copyright and license details. */
#ifndef CONNECTION_H
#define CONNECTION_H
#include "http.h"
#include "server.h"
#include "util.h"
enum connection_state {
C_VACANT,
C_RECV_HEADER,
C_SEND_HEADER,
C_SEND_BODY,
NUM_CONN_STATES,
};
struct connection {
enum connection_state state;
int fd;
struct sockaddr_storage ia;
struct request req;
struct response res;
struct buffer buf;
size_t progress;
};
struct connection *connection_accept(int, struct connection *, size_t);
void connection_log(const struct connection *);
void connection_reset(struct connection *);
void connection_serve(struct connection *, const struct server *);
#endif /* CONNECTION_H */