*** ../ircu2.10.04/include/s_serv.h Wed Jun 17 12:58:38 1998 --- ../ircu2.10.04+/include/s_serv.h Wed Jun 17 12:57:16 1998 *************** *** 61,66 **** --- 61,67 ---- extern int max_connection_count, max_client_count; #ifdef DB_ESNET + extern unsigned long db_num_serie_local; extern void tea(unsigned long v[],unsigned long k[],unsigned long x[]); extern void reload_db(void); extern void initdb(void); *** ../ircu2.10.04/ircd/s_bsd.c Wed Jun 17 12:58:37 1998 --- ../ircu2.10.04+/ircd/s_bsd.c Wed Jun 17 12:57:17 1998 *************** *** 967,972 **** --- 967,975 ---- sendto_one(cptr, "SERVER %s 1 %lu %lu J%s %s :%s", my_name_for_link(me.name, aconf), me.serv->timestamp, newts, MAJOR_PROTOCOL, me.yxx, me.info); + #ifdef DB_ESNET + sendto_one(cptr,"%c DB * 0 J %lu",me.yxx[0],db_num_serie_local); + #endif if (!IsDead(cptr)) start_auth(cptr); *** ../ircu2.10.04/ircd/s_debug.c Wed Jun 17 12:58:39 1998 --- ../ircu2.10.04+/ircd/s_debug.c Wed Jun 17 12:57:17 1998 *************** *** 196,202 **** '-', #endif #endif ! 'D','B', #ifdef DB_ESNET '+', #else --- 196,202 ---- '-', #endif #endif ! 'D','B','2', #ifdef DB_ESNET '+', #else *** ../ircu2.10.04/ircd/s_serv.c Wed Jun 17 12:58:39 1998 --- ../ircu2.10.04+/ircd/s_serv.c Wed Jun 17 12:57:17 1998 *************** *** 804,809 **** --- 804,812 ---- my_name_for_link(me.name, aconf), me.serv->timestamp, cptr->serv->timestamp, MAJOR_PROTOCOL, me.yxx, (me.info[0]) ? (me.info) : "IRCers United"); + #ifdef DB_ESNET + sendto_one(cptr,"%c DB * 0 J %lu",me.yxx[0],db_num_serie_local); + #endif } det_confs_butmask(cptr, *************** *** 1187,1193 **** ** El 1 son los registros que no son nuestros, para poder compactar luego la DB. */ static struct DB_nick *nick_db[2]={NULL,NULL}; ! static unsigned long db_num_serie_local=0; /* * db_manage_nick --- 1190,1196 ---- ** El 1 son los registros que no son nuestros, para poder compactar luego la DB. */ static struct DB_nick *nick_db[2]={NULL,NULL}; ! unsigned long db_num_serie_local=0; /* * db_manage_nick *************** *** 1303,1308 **** --- 1306,1312 ---- int handle; nick_db[0]=nick_db[1]=NULL; + db_num_serie_local=0; if(!(handle=abrir_db(0,buf))) return; do { db_alta(buf); *************** *** 1311,1322 **** } /* ! * reload_db * ! * Recarga la base de datos de disco, liberando la memoria * */ ! void reload_db(void) { struct DB_nick *n,*n2; --- 1315,1326 ---- } /* ! * borrar_db * ! * Borra la base de datos en memoria * */ ! void borrar_db(void) { struct DB_nick *n,*n2; *************** *** 1333,1339 **** --- 1337,1355 ---- RunFree(n); n=n2; } + nick_db[0]=nick_db[1]=NULL; + db_num_serie_local=0; + } + /* + * reload_db + * + * Recarga la base de datos de disco, liberando la memoria + * + */ + void reload_db(void) + { + borrar_db(); initdb(); sendto_ops("Releyendo la base de datos. Ultimo registro: %lu",db_num_serie_local); } *************** *** 1353,1359 **** db_nick=nick_db[0]; while(db_nick!=NULL) { - sendto_ops("Nick %s",db_nick->nick); if(!strcmp(db_nick->nick,n)) break; db_nick=db_nick->siguiente; } --- 1369,1374 ---- *************** *** 1436,1442 **** db_file=open("database",O_TRUNC,S_IRUSR | S_IWUSR); alarm(0); close(db_file); ! db_num_serie_local=0; } sendto_one(sptr,"%c DB %s 0 q %lu HASH\n",me.yxx[0],parv[0],db_num_serie_local); return 0; --- 1451,1457 ---- db_file=open("database",O_TRUNC,S_IRUSR | S_IWUSR); alarm(0); close(db_file); ! borrar_db(); } sendto_one(sptr,"%c DB %s 0 q %lu HASH\n",me.yxx[0],parv[0],db_num_serie_local); return 0;