first commit
This commit is contained in:
25
CS4210/Project 3/common/http/http.h
Normal file
25
CS4210/Project 3/common/http/http.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <sys/types.h>
|
||||
#define BUFFERSIZE 1024 /* max size for recv buffer */
|
||||
#define LOOP_BOUNDS 2 // Tolerance of the recv() loop.
|
||||
|
||||
typedef struct _http_request {
|
||||
char method[10];
|
||||
char path[BUFFERSIZE];
|
||||
char protocol[15];
|
||||
} http_request;
|
||||
|
||||
|
||||
/* Forwards. */
|
||||
/* Note to Puyan: you do not declare static functions in the header file, kkthx */
|
||||
/*static void file_details( char* dir, char* name , FILE *socket_file);
|
||||
static void send_error( int status, char* title, char* extra_header, char* text, FILE *socket_file );
|
||||
static void send_headers( int status, char* title, char* extra_header, char* mime_type, off_t length, time_t mod, FILE *socket_file );
|
||||
static char* get_mime_type( char* name );
|
||||
static void strdecode( char* to, char* from );
|
||||
static int hexit( char c );
|
||||
static void strencode( char* to, size_t tosize, const char* from );*/
|
||||
|
||||
|
||||
void http_proto(int socket, char *request);
|
||||
int parse_request(char *request, http_request *package);
|
||||
|
||||
Reference in New Issue
Block a user