summaryrefslogtreecommitdiff
path: root/src/ePreDefine.h
blob: cb20892bc6ab9aff9785b8c1a8522698cd4c510c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * main.h
 *
 *  Created on: 2013. 9. 12.
 *      Author: kos
 */

#ifndef FILESTREAMPROXY_H_
#define FILESTREAMPROXY_H_

#define BUFFER_SIZE		(188*256)
#define MAX_LINE_LENGTH	(1024)

#define RETURN_ERR_400(FMT,...) { printf("HTTP/1.0 400 Bad Request\r\n"FMT"\r\n\r\n", ##__VA_ARGS__); return 1; }
#define RETURN_ERR_401(FMT,...) { printf("HTTP/1.0 401 Unauthorized\r\n"FMT"\r\n\r\n",##__VA_ARGS__); return 1; }
#define RETURN_ERR_502(FMT,...) { printf("HTTP/1.0 502 Bad Gateway\r\n"FMT"\r\n\r\n", ##__VA_ARGS__); return 1; }
//-------------------------------------------------------------------------------

char* ReadRequest(char* aRequest);

#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>

#ifdef DEBUG_LOG
	extern FILE* fpLog;
	#define LOG(X,...) { fprintf(fpLog, "%s:%s(%d) "X"\n",__FILE__,__FUNCTION__,__LINE__,##__VA_ARGS__); fflush(fpLog); }
#endif /*DEBUG_LOG*/

#endif /* FILESTREAMPROXY_H_ */