//
// cgiConfig()
//
static int cgiConfig(SOCKET htmlSock, int ContentLength, char *pArgs )
{
char *qualstr = 0;
char *buffer, *key, *value;
int len,quality;
int parseIndex;
// CGI Functions can now support URI arguments as well if the
// pArgs pointer is not NULL, and the ContentLength were zero,
// we could parse the arguments off of pArgs instead.
// First, allocate a buffer for the request
buffer = (char*) mmBulkAlloc( ContentLength + 1 );
if ( !buffer )
goto ERROR;
// Now read the data from the client
len = recv( htmlSock, buffer, ContentLength, MSG_WAITALL );
if ( len < 1 )
goto ERROR;
// Setup to parse the post data
parseIndex = 0;
buffer[ContentLength] = ' ';
// Process request variables until there are none left
do
{
key = cgiParseVars( buffer, &parseIndex );
value = cgiParseVars( buffer, &parseIndex );
if( !strcmp("quality", key) )
qualstr = value;
} while ( parseIndex != -1 );
//
// Output the data we read in...
//
httpSendStatusLine(SOCKET htmlSock, HTTP_OK, CONTENT_TYPE_HTML);
// CRLF before entity
html( CRLF);
//
// Generate response
//
// If the password is incorrect or missing, generate an error
if( qualstr )
{
quality = 0;
while( *qualstr )
quality = quality * 10 + (*qualstr++ - '0');
if( quality > 0 && quality <= 100 )
thrControlSet( 1, quality );
}
// Send back the same default page
send(htmlSock, DEFAULT, DEFAULT_SIZE, 0 );
ERROR:
if( buffer )
mmBulkFree( buffer );
return( 1 );
}
"webpage.c", line 97: error: type name is not allowed
"webpage.c", line 97: error: too few arguments in function call
"webpage.c", line 97: error: expected a ")"
"webpage.c", line 99: error: type name is not allowed
"webpage.c", line 99: error: too few arguments in function call
"webpage.c", line 99: error: expected a ")"
麻烦各位大神帮忙解决,非常感谢。。
一周热门 更多>