Exemplo n.º 1
0
/*! \brief
 * Timer handler
 */
static void timer(unsigned int ticks, void* param) {
	LM_DBG("Syncing cache\n");
	if (usrloc_debug) {
		print_all_udomains(debug_file);
		fflush(debug_file);
	}

	if (synchronize_all_udomains() != 0) {
		LM_ERR("synchronizing cache failed\n");
	}
}
Exemplo n.º 2
0
int static ul_dump(FILE* pipe, char* response_file)
{
	FILE* reply_file;

	reply_file=open_reply_pipe(response_file);
	if (reply_file==0) {
		LOG(L_ERR, "ERROR: ul_dump: file not opened\n");
		return -1;
	}
	fputs( "200 ok\n", reply_file);
	print_all_udomains(reply_file);
	fclose(reply_file);
	return 1;
}
Exemplo n.º 3
0
static void rpc_dump_file(rpc_t* rpc, void* c)
{
	str filename;
	FILE *file;
	
	if (rpc->scan(c, "S", &filename) < 1) {
		return;
	}
	
	DBG("dumping to file '%.*s'.\n", filename.len, ZSW(filename.s));
	if (! (file = fopen(filename.s, "w"))) {
		ERR("failed to open file `%s'.\n", filename.s);
		rpc->fault(rpc, 500, "failed to open file `%s'.\n", filename.s);
		return;
	}
	print_all_udomains(file);
	fclose(file);
}