Ignore:
Timestamp:
Aug 11, 2010, 2:51:39 PM (10 years ago)
Author:
djay
Message:

Update the cgic library to let run the ZOO Kernel from the command line.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/thirds/cgic206/cgic.c

    r1 r6  
    136136        cgiGetenv(&cgiServerPort, "SERVER_PORT");
    137137        cgiGetenv(&cgiRequestMethod, "REQUEST_METHOD");
     138        if(strcmp(cgiRequestMethod,"")==0 && argc>=1)
     139                cgiRequestMethod="GET";
    138140        cgiGetenv(&cgiPathInfo, "PATH_INFO");
    139141        cgiGetenv(&cgiPathTranslated, "PATH_TRANSLATED");
    140142        cgiGetenv(&cgiScriptName, "SCRIPT_NAME");
    141143        cgiGetenv(&cgiQueryString, "QUERY_STRING");
     144        if(strcmp(cgiQueryString,"")==0 && argc>=2){
     145                cgiQueryString=argv[1];
     146        }else
     147                fprintf(stderr,"cgiQueryString : %s\n",cgiQueryString);
    142148        cgiGetenv(&cgiRemoteHost, "REMOTE_HOST");
    143149        cgiGetenv(&cgiRemoteAddr, "REMOTE_ADDR");
     
    190196        cgiGetenv(&cgiContentLengthString, "CONTENT_LENGTH");
    191197        cgiContentLength = atoi(cgiContentLengthString);       
     198        if(cgiContentLength==0 && argc>=2){
     199                cgiContentLength=strlen(argv[1]);
     200        }
     201        fprintf(stderr,"%d\n",cgiContentLength);
    192202        cgiGetenv(&cgiAccept, "HTTP_ACCEPT");
    193203        cgiGetenv(&cgiUserAgent, "HTTP_USER_AGENT");
     
    208218#endif /* WIN32 */
    209219        cgiFormEntryFirst = 0;
    210         cgiIn = stdin;
    211         cgiOut = stdout;
     220        cgiIn = FCGI_stdin;
     221        cgiOut = FCGI_stdout;
    212222        cgiRestored = 0;
    213223
     
    293303        cgiFreeResources();
    294304        }
     305        FCGI_Finish();
    295306        return result;
    296307}
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png