검색어 입력폼

C언어 CGI 소스분석

저작시기 2007.04 |등록일 2007.04.23 한글파일한컴오피스 (hwp) | 37페이지 | 가격 10,000원

소개글

C로 짠 CGI 소스를 분석 실행한 레포트.

본문내용

#define cgiStrEq(a, b) (!strcmp((a), (b)))

char *cgiServerSoftware;
char *cgiServerName;
char *cgiGatewayInterface;
char *cgiServerProtocol;
char *cgiServerPort;
char *cgiRequestMethod;
char *cgiPathInfo;
char *cgiPathTranslated;
char *cgiScriptName;
char *cgiQueryString;
char *cgiRemoteHost;
char *cgiRemoteAddr;
char *cgiAuthType;
char *cgiRemoteUser;
char *cgiRemoteIdent;
char *cgiContentType;
int cgiContentLength;
char *cgiAccept;
char *cgiUserAgent;

FILE *cgiIn;
FILE *cgiOut;

/* One form entry, consisting of an attribute-value pair. */
/* value와 attribute를 저장할 struct. liked list로 구현되있다.*/
typedef struct cgiFormEntryStruct {
char *attr; // 여기에 attribute들이 들어간다.
char *value; // 여기에 value들이 들어간다.
struct cgiFormEntryStruct *next; //다시 자신을 가리킴으로 liked list 구현.
} cgiFormEntry;

/* The first form entry. */
static cgiFormEntry *cgiFormEntryFirst; // 리스트의 첫번째를 가리킬 변수.

/* True if CGI environment was restored from a file. */
static int cgiRestored = 0;

static void cgiGetenv(char **s, char *var);

typedef enum {
cgiParseSuccess,
cgiParseMemory,
cgiParseIO
} cgiParseResultType;

static cgiParseResultType cgiParseGetFormInput();
static cgiParseResultType cgiParsePostFormInput();
static cgiParseResultType cgiParseFormInput(char *data, int length);
static void cgiSetupConstants();
다운로드 맨위로