void affichageFeux(int tab[], int size){ int i; for(i=0;i<size;i++){ if(tab[i]==0){ printf("%s : - GREEN -\n", stringConvert(i)); } else{ printf("%s : X RED X\n", stringConvert(i)); } } printf("---------\n"); }
operator const char*() { return stringConvert(str_); }
static void func_sys_after_parse_param() { int i; for(i = 0 ; i < mod->mod_params.count; i++) { cc_mod_param *mod_param = mod->mod_params.items[i]; mod_config *cfg = mod_param->param; // add by xueye.zhao // 2013-4-18 if (is_http_move_status(cfg->ResponseStatus)) { continue; } // end add if(is_url(cfg->location)) { struct stat sb; if (stat("/data/proclog/log/squid/customized_error_page", &sb) != 0){ mkdir("/data/proclog/log/squid/customized_error_page", S_IRWXU); } FILE *fp = popen("/usr/local/squid/bin/get_file_from_url.pl", "r"); assert(fp); while(1) { char perloutput[512]; if(!fgets(perloutput, 512, fp)) { break; } debug(115, 1)("mod_customized_server_side_error_page get_file_from_url.pl said: %s\n", perloutput); } pclose(fp); /* if (stat("/data/proclog/log/squid/customized_error_page", &sb) != 0){ mkdir("/data/proclog/log/squid/customized_error_page", S_IRWXU); } */ if(stringConvert((cfg->location))) { debug(115,0) ( "mod_customized_server_side_error_page: cfg->location url error\n"); continue; } debug(115,4) ( "mod_customized_server_side_error_page: cfg->location is: %s\n", cfg->location); //char* tmp = NULL; String tmp = StringNull; stringInit(&tmp, "/data/proclog/log/squid/customized_error_page/"); stringAppend(&tmp, cfg->location+7, strlen(cfg->location)-7); memset(cfg->location,0,sizeof(cfg->location)); strncpy(cfg->location,strBuf(tmp),strLen(tmp)); errorTryLoadText(&cfg->customized_error_text, cfg->location); stringClean(&tmp); } else { //cfg->is_url = 0; errorTryLoadText(&cfg->customized_error_text, cfg->location); } } }