distroquery.cpp: realign main code
This commit is contained in:
parent
659b2ba778
commit
6732bdccfe
@ -1608,52 +1608,52 @@ void parse_request_variables(char *data) {
|
|||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
char *data;
|
||||||
|
int responsed = 0;
|
||||||
|
|
||||||
char *data;
|
// install backtrace handler
|
||||||
int responsed = 0;
|
signal(SIGSEGV, backtraceHandler);
|
||||||
|
|
||||||
// install backtrace handler
|
firstconfigtag = read_configuration(DEFAULT_CONFIGFILE);
|
||||||
signal(SIGSEGV, backtraceHandler);
|
if (!firstconfigtag) {
|
||||||
|
fprintf(stderr, "Fatal error while parsing config file " DEFAULT_CONFIGFILE "; aborting.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
firstconfigtag = read_configuration(DEFAULT_CONFIGFILE);
|
data = getenv("QUERY_STRING");
|
||||||
if (!firstconfigtag) {
|
if (data && strlen(data)) {
|
||||||
fprintf(stderr, "Fatal error while parsing config file " DEFAULT_CONFIGFILE "; aborting.\n");
|
parse_request_variables(data);
|
||||||
exit(1);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
data = getenv("QUERY_STRING");
|
|
||||||
if (data && strlen(data)) {
|
|
||||||
parse_request_variables(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!reply_plain)
|
if (!reply_plain)
|
||||||
printf("Content-Type: text/xml;charset=utf-8\n\n<distroquery>");
|
printf("Content-Type: text/xml;charset=utf-8\n\n<distroquery>");
|
||||||
else
|
else
|
||||||
printf("Content-Type: text/html;charset=utf-8\n\n");
|
printf("Content-Type: text/html;charset=utf-8\n\n");
|
||||||
|
|
||||||
setlocale(LC_ALL, lang);
|
setlocale(LC_ALL, lang);
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
|
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
|
||||||
if (query_package && strlen(query_package)) {
|
if (query_package && strlen(query_package)) {
|
||||||
if (query_arch)
|
if (query_arch)
|
||||||
printPackageData();
|
printPackageData();
|
||||||
else
|
else
|
||||||
printSourcePackageData();
|
printSourcePackageData();
|
||||||
responsed = 1;
|
responsed = 1;
|
||||||
} else if (query && strlen(query)) {
|
} else if (query && strlen(query)) {
|
||||||
if (query[0] == '$')
|
if (query[0] == '$')
|
||||||
printSpecialQueryResponse();
|
printSpecialQueryResponse();
|
||||||
else
|
else
|
||||||
printQueryResponse();
|
printQueryResponse();
|
||||||
responsed = 1;
|
responsed = 1;
|
||||||
} else if (query_path) {
|
} else if (query_path) {
|
||||||
printFileBrowser();
|
printFileBrowser();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!responsed || (responsed && searchbox)) printInputForm();
|
if (!responsed || (responsed && searchbox)) printInputForm();
|
||||||
|
|
||||||
if (!reply_plain) printf("</distroquery>\n");
|
if (!reply_plain) printf("</distroquery>\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user