turn server into library + driver code
This commit is contained in:
26
http.h
Normal file
26
http.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef HTTP_H
|
||||
#define HTTP_H
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
typedef struct {
|
||||
int client_sock;
|
||||
char *method;
|
||||
char *target;
|
||||
char *version;
|
||||
/* Field_Lines (Header) */
|
||||
char *body;
|
||||
} HTTP_Request;
|
||||
|
||||
typedef struct {
|
||||
char *version;
|
||||
unsigned int status;
|
||||
/* Field_Lines (Header) */
|
||||
char *body;
|
||||
} HTTP_Response;
|
||||
|
||||
int http_init(int port, int connection_amount);
|
||||
HTTP_Request* http_accept(int server);
|
||||
|
||||
#endif /* HTTP_H */
|
Reference in New Issue
Block a user