当前位置: 首页>>代码示例>>C++>>正文


C++ FCGI_Accept函数代码示例

本文整理汇总了C++中FCGI_Accept函数的典型用法代码示例。如果您正苦于以下问题:C++ FCGI_Accept函数的具体用法?C++ FCGI_Accept怎么用?C++ FCGI_Accept使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FCGI_Accept函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fcgi_accept

int fcgi_accept()
{
#ifdef Q_OS_WIN
  if ( FCGX_IsCGI() )
    return FCGI_Accept();
  else
    return FCGX_Accept( &FCGI_stdin->fcgx_stream, &FCGI_stdout->fcgx_stream, &FCGI_stderr->fcgx_stream, &environ );
#else
  return FCGI_Accept();
#endif
}
开发者ID:geodenilson,项目名称:Quantum-GIS,代码行数:11,代码来源:qgis_map_serv.cpp

示例2: http_thread

void http_thread(void *args)
{
    if(!init()) {
        print("http_init() failed\n");
        return;
    }

    while(FCGI_Accept() >= 0)
    {
        FCGI_printf("Content-type: text/html\r\nStatus: 200 OK\r\n\r\n");

        char *name = getenv("SCRIPT_NAME");
        _Bool q = 0;

        if(name[0] == '/' && name[1] == 'q') {
            if(name[2] == 0) {
                q = 1;
            } else if(strcmp(name + 2, "key") == 0) {
                uint8_t k[64];
                key_to_string(k, key.public);
                FCGI_fwrite(k, sizeof(k), 1, FCGI_stdout);
                continue;
            } else if(strcmp(name + 2, "stat") == 0) {
                FCGI_printf("Number of registered names: %u<br/>Number of successful Tox DNS requests: %u\n", stat.registered, stat.requests);
                continue;
            }
        }
开发者ID:GrayHatter,项目名称:tox-dns,代码行数:27,代码来源:http.c

示例3: luafcgi_accept

static int luafcgi_accept( lua_State * const L ) {
	const int rv = FCGI_Accept();

	lua_pushboolean( L, rv == 0 );

	return 1;
}
开发者ID:abyxcos,项目名称:lua-fcgi,代码行数:7,代码来源:main.c

示例4: main

int main ()
{
    char **initialEnv = environ;

    g_cgi_cfg = new CCgiCfg("/data/server/cgi-bin/sh/cgi_cfg.txt");

    while (FCGI_Accept() >= 0)
    {
        CIfBase* ifobj = CIfFactory::getIfObj();
        if(ifobj == NULL)
        {
            LogError("error_env_platform", "");
            continue;
        }

        ifobj->SetServName(my_getenv("SERVER_NAME"));
        char* pszReq = my_getenv("QUERY_STRING");
        ifobj->login(pszReq);
        delete ifobj;
    }

    delete (CWorldBase*)g_pTheWorld;

    return 0;
}
开发者ID:Joinhack,项目名称:fragement,代码行数:25,代码来源:login_fcgi.cpp

示例5: main

int main() {
	Database *db = Database::getInstance();
	Session *session = Session::getInstance();

	while (FCGI_Accept() >= 0) {
		Json::FastWriter fw; 
		Json::Value root;
		string result("fail");
		string detail("");
		session->sessionInit();
		vector<unordered_map<string,string> >   query_result;
		if(session->checkSession() == false){
			detail = detail + "unlogin";

		}else{

			char query_buf[1024] = {0};
			string user_id;
			user_id = session->getValue("user_id");

<<<<<<< HEAD
			snprintf(query_buf,sizeof(query_buf),"select b.no_id, b.type, a.user_id, a.username, b.additional_message, b.created_time from users a INNER JOIN (select * from notification  where rece_id = %d and state = 0) b on a.user_id = b.rece_id union  select b.no_id, b.type, b.send_id, a.username, b.additional_message, b.created_time from users a INNER JOIN (select * from notification  where send_id = %d and state = 1) b on a.user_id = b.send_id",atoi(user_id.c_str()),atoi(user_id.c_str()));
=======
			snprintf(query_buf,sizeof(query_buf),"(SELECT no_id,type,send_id,notification.state,username,nickname,created_time,additional_message FROM notification inner join users on users.user_id=send_id where rece_id=%d and notification.state=0) union (SELECT no_id,type,rece_id as send_id,notification.state,username,nickname,created_time,additional_message FROM notification inner join users on users.user_id=rece_id where send_id=%d and notification.state=1)",atoi(user_id.c_str()),atoi(user_id.c_str()));
>>>>>>> 637973e20ec3876ad1a721cb4a71526d24d68c4f
开发者ID:Kallima03,项目名称:cgi_web,代码行数:25,代码来源:get_notification.cpp

示例6: main

int main () {
    char * request_uri;

    /* Load the controller .so from this sub directory */
    route_import_controllers("controllers/");

    /* Initialize session system */
    session_init();

    while (FCGI_Accept() >= 0) {
      /* Record start time */
      gettimeofday(&start_time,NULL);

      request_uri = cleanrequest( getenv("REQUEST_URI"));

      /* Initialize session for this request */
      fprintf(stderr, "Request for %s\n", request_uri );

      /* Dispatch the request to the correct controller */
      route_dispatch(request_uri);
      free(request_uri);
     
      /* Calculate total runtime of the operation */
      gettimeofday(&end_time,NULL);
      timeval_diff( &difference_time, &end_time, &start_time );      

      printf("time: %ld.%06ld\n", difference_time.tv_sec, difference_time.tv_usec);

      FCGI_Finish();
    }

    fprintf(stderr, "FF Exiting\n");
    return 0;
}
开发者ID:adamsch1,项目名称:ff,代码行数:34,代码来源:main.c

示例7: ows_error

/*
 * Return an ExceptionReport as specified in OWS 1.1.0 specification
 */
void ows_error(ows * o, enum ows_error_code code, char *message, char *locator)
{
  assert(o);
  assert(message);
  assert(locator);

  assert(!o->exit);
  o->exit = true;

  ows_log(o, 1, message);

#if TINYOWS_FCGI
  if ((o->init && FCGI_Accept() >= 0) || !o->init) {
#endif
    fprintf(o->output, "Content-Type: application/xml\n\n");
    fprintf(o->output, "<?xml version='1.0' encoding='UTF-8'?>\n");
    fprintf(o->output, "<ows:ExceptionReport\n");
    fprintf(o->output, " xmlns='http://www.opengis.net/ows'\n");
    fprintf(o->output, " xmlns:ows='http://www.opengis.net/ows'\n");
    fprintf(o->output, " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n");
    fprintf(o->output, " xsi:schemaLocation='http://www.opengis.net/ows");
    fprintf(o->output, " http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd'\n");
    fprintf(o->output, " version='1.1.0' language='en'>\n");
    fprintf(o->output, " <ows:Exception exceptionCode='%s' locator='%s'>\n",
            ows_error_code_string(code), locator);
    fprintf(o->output, "  <ows:ExceptionText>%s</ows:ExceptionText>\n", message);
    fprintf(o->output, " </ows:Exception>\n");
    fprintf(o->output, "</ows:ExceptionReport>\n");

#if TINYOWS_FCGI
    fflush(o->output);
  }
#endif
}
开发者ID:Ezio47,项目名称:tinyows,代码行数:37,代码来源:ows_error.c

示例8: main

int main() {
	while (FCGI_Accept() >= 0) {
		printf("Content-type: text\r\n");
		printf("Set-Cookie: name=value with spaces; and a semicolon\r\n");
		printf("Set-Cookie: name2=value2\r\n\r\n");
		printf("Cookie:%s\n", getenv("COOKIE_STRING"));
	}
}
开发者ID:119,项目名称:MCTX3420,代码行数:8,代码来源:test.c

示例9: ewf_fastcgi_accept

int ewf_fastcgi_accept( void )
{
    if ( FCGI_Accept(  ) < 0 ) {
	return EWF_ERROR;
    }

    return EWF_SUCCESS;
}
开发者ID:neufbox,项目名称:misc,代码行数:8,代码来源:ewf_fastcgi.c

示例10: soap_serve

SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap* soap)
{
#ifndef WITH_FASTCGI
    unsigned int k = soap->max_keep_alive;
#endif

    do
    {
#ifdef WITH_FASTCGI
        if (FCGI_Accept() < 0)
        {
            soap->error = SOAP_EOF;
            return soap_send_fault(soap);
        }
#endif

        soap_begin(soap);

#ifndef WITH_FASTCGI
        if (soap->max_keep_alive > 0 && !--k)
            soap->keep_alive = 0;
#endif

        if (soap_begin_recv(soap))
        {
            if (soap->error < SOAP_STOP)
            {
#ifdef WITH_FASTCGI
                soap_send_fault(soap);
#else
                return soap_send_fault(soap);
#endif
            }
            soap_closesock(soap);

            continue;
        }

        if (soap_envelope_begin_in(soap)
                || soap_recv_header(soap)
                || soap_body_begin_in(soap)
                || soap_serve_request(soap)
                || (soap->fserveloop && soap->fserveloop(soap)))
        {
#ifdef WITH_FASTCGI
            soap_send_fault(soap);
#else
            return soap_send_fault(soap);
#endif
        }

#ifdef WITH_FASTCGI
        soap_destroy(soap);
        soap_end(soap);
    }
    while (1);
#else
    } while (soap->keep_alive);
开发者ID:249CAAFE40,项目名称:mangos-wotlk,代码行数:58,代码来源:soapServer.cpp

示例11: main

int main(int argc, char *argv)
{
	int count = 0;
	while (FCGI_Accept() >= 0) {
		FCGI_printf("Content-type: text/*\r\n\r\n");
		printf("Hi, I am Zhangpengpeng.\t %d %s \n", count++, getenv("SERVER_NAME"));
	}
	return 0;
}
开发者ID:rocflyhi,项目名称:glow,代码行数:9,代码来源:demo.c

示例12: main

int main(void){
    pci_init();
#ifdef ENABLE_FASTCGI
    while(FCGI_Accept() >= 0) {
#endif
    qentry_t *req = qcgireq_parse(NULL, 0);
    
    char *name  = req->getstr(req, "username", true);
    if(name == NULL){
        qcgires_redirect(req, BAD_REGISTER);
        goto end;
    }

    char *admin = req->getstr(req, "adminpassword", true);
    if(admin == NULL){
    	qcgires_redirect(req, BAD_REGISTER);
    	free(name);
    	goto end;
    }

    if(strncmp(admin, ADMIN_SECRET, strlen(ADMIN_SECRET)) != 0){
    	fprintf(stderr, "%s%s\n", "Invalid Registration Attempt: ", admin);
    	qcgires_redirect(req, BAD_REGISTER);
    	free(name);
    	free(admin);
    	goto end;
    }

    if( create_user(name) == 1 ){   	
    	/* Log the User in */
    	qentry_t *sess = NULL;
		sess = qcgisess_init(req, NULL);
        qcgisess_settimeout(sess, SESSION_TIME);
		if(sess){
            sess->putstr(sess, "username", name, true);
            qcgisess_save(sess);
            sess->free(sess);            
        } 
        qcgires_redirect(req, APPLICATION);
    }else{
    	fprintf(stderr, "%s%s\n", "Could not create user: ", name);
    	qcgires_redirect(req, BAD_REGISTER);
    }

    free(name);
    free(admin);

    end:
    qcgires_setcontenttype(req, "text/html");
    // De-allocate memories
    req->free(req);
#ifdef ENABLE_FASTCGI
    }
#endif
    return 0;
}
开发者ID:EdgeCaseBerg,项目名称:pChat,代码行数:56,代码来源:create-user.c

示例13: main

/********************************************************************
* FUNCTION main
*
* STDIN is input from the HTTP server through FastCGI wrapper 
*   (sent to ncxserver)
* STDOUT is output to the HTTP server (rcvd from ncxserver)
* 
* RETURNS:
*   0 if NO_ERR
*   1 if error connecting or logging into ncxserver
*********************************************************************/
int main (int argc, char **argv, char **envp)
{
    int status = 0;
    yang_api_profile_t  yang_api_profile;

    /* setup global vars used across all requests */
    status = yang_api_init(&yang_api_profile);

    if (status != OK) {
        printf("Content-type: text/html\r\n\r\n"
               "<html><head><title>YANG-API echo</title></head>"
               "<body><h1>YANG-API init failed</h1></body></html>\n");
    }

    /* temp: exit on all errors for now */
    while (status == OK && FCGI_Accept() >= 0) {
#ifdef DEBUG_TRACE
        printf("Content-type: text/html\r\n\r\n"
               "<html><head><title>YANG-API echo</title></head>"
               "<body><h1>YANG-API echo</h1>\n<pre>\n");
        PrintEnv("Request environment", environ);
#endif

        status = save_environment_vars(&yang_api_profile);
        if (status != OK) {
            continue;
        }

        status = setenv("REMOTE_USER", yang_api_profile.username, 0);
        if (status != 0) {
            continue;
        }

#ifdef DEBUG_TRACE
        printf("start invoke netconf-subsystem-pro\n");
#endif

        status = run_subsystem_ex(PROTO_ID_YANGAPI, 3, argc, argv, envp,
                                  read_yangapi_buff, send_yangapi_buff,
                                  yang_api_profile.content_length);
        if (status != OK) {
            continue;
        }

#ifdef DEBUG_TRACE
        printf("\n</pre></body></html>\n");
#endif

        cleanup_request(&yang_api_profile);
    } /* while */

    yang_api_cleanup(&yang_api_profile);

    return status;

}  /* main */
开发者ID:pikagrue,项目名称:test-repository-2,代码行数:67,代码来源:yang_api.c

示例14: main

int main(int argc, char **argv)
{
    initialize();

    while (FCGI_Accept() >= 0) {
        handle_request();
    }

    return 0;
}
开发者ID:paulquevedo,项目名称:raspi,代码行数:10,代码来源:server.c

示例15: main

/*
 * A typical FastCGI main program: Initialize, then loop
 * calling FCGI_Accept and performing the accepted request.
 * Do cleanup operations incrementally between requests.
 */
void main(void)
{
    Initialize();
    while(FCGI_Accept() >= 0) {
        PerformRequest();
        FCGI_Finish();
        GarbageCollectStep();
        ConditionalCheckpoint();
    }
}
开发者ID:TVilaboa,项目名称:InvestigacionC,代码行数:15,代码来源:main.c


注:本文中的FCGI_Accept函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。