Ejemplo n.º 1
0
int Http_ConnInit(HTTPCONNECTION hConnection, void *pParam, GETPOST_CALLER_PFUN funCaller)
{
	char *pcQuery;
	CO_PARAM_T *pCoParam;

	switch (httpGetMethod(hConnection))
	{
	case M_POST:
		if ((pCoParam = (CO_PARAM_T *)malloc(sizeof(CO_PARAM_T))) != NULL)
		{
			pCoParam->pParam = pParam;
			pCoParam->funCmdCaller = funCaller;
			httpSetPostDataFun(hConnection, Http_PostDataGet, (void *)pCoParam);
		}
		else
			PRINT_MEM_OUT;
		return 1;
	case M_GET:
		pcQuery = httpGetQueryString(hConnection);
		if (pcQuery == NULL) pcQuery = "";
		return (*funCaller)(hConnection, pcQuery, strlen(pcQuery), pParam);
	}
	return -1;
}
Ejemplo n.º 2
0
cchar *espGetQueryString(HttpConn *conn)
{
    return httpGetQueryString(conn);
}