}
-
/*
* Traverse the visits file...
*/
}
-
void migr_export_openids(void) {
struct cdbdata *cdboi;
long usernum;
}
-
-
void migr_export_messages(void) {
char buf[SIZ];
long msgnum;
}
fclose(migr_global_message_list);
}
- if (Ctx->kill_me == 0)
+ if (Ctx->kill_me == 0) {
syslog(LOG_INFO, "Exported %d messages.", count);
- else
+ }
+ else {
syslog(LOG_ERR, "Export aborted due to client disconnect!");
+ }
migr_export_message(-1L); /* This frees the encoding buffer */
}
-
void migr_do_export(void) {
CitContext *Ctx;
}
-
-
/******************************************************************************
* Import code *
* Here's the code that implements the import side. It's going to end up *
return 1;
}
+
int migr_floorrecord(void *data, const char *el)
{
- if (!strcasecmp(el, "f_num")) floornum = atoi(ChrPtr(migr_chardata));
+ if (!strcasecmp(el, "f_num")) floornum = atoi(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "f_flags")) flbuf.f_flags = atoi(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "f_name")) safestrncpy(flbuf.f_name, ChrPtr(migr_chardata), sizeof flbuf.f_name);
else if (!strcasecmp(el, "f_ref_count")) flbuf.f_ref_count = atoi(ChrPtr(migr_chardata));
return 1;
}
+
int migr_visitrecord(void *data, const char *el)
{
if (!strcasecmp(el, "v_roomnum")) vbuf.v_roomnum = atol(ChrPtr(migr_chardata));
}
/*** VISITS ***/
- else if ((!strncasecmp(el, HKEY("v_"))) &&
- migr_visitrecord(data, el))
+ else if ((!strncasecmp(el, HKEY("v_"))) && migr_visitrecord(data, el)) {
; /* Nothing to do anymore */
+ }
else if (!strcasecmp(el, "visit")) {
put_visit(&vbuf);
syslog(LOG_INFO, "Imported visit: %ld/%ld/%ld", vbuf.v_roomnum, vbuf.v_roomgen, vbuf.v_usernum);
}
-
-
/*
* Import begins here
*/
client_set_inbound_buf(SIZ * 10);
while (!Finished && client_read_random_blob(Buf, -1) >= 0) {
- if ((StrLength(Buf) > 4) &&
- !strcmp(ChrPtr(Buf) + StrLength(Buf) - 4, "000\n"))
- {
+ if ((StrLength(Buf) > 4) && !strcmp(ChrPtr(Buf) + StrLength(Buf) - 4, "000\n")) {
Finished = 1;
StrBufCutAt(Buf, StrLength(Buf) - 4, NULL);
}
smi.meta_rfc822_length = StrLength(CCC->redirect_buffer);
CCC->redirect_buffer = NULL;
-
syslog(LOG_INFO,
"Setting message #%ld meta data to: refcount=%d, bodylength=%ld, content-type: %s",
smi.meta_msgnum,
return 0;
}
+
void migr_check_room_msg(long msgnum, void *userdata) {
fprintf(migr_global_message_list, "%ld %s\n", msgnum, CC->room.QRname);
}
CtdlForEachMessage(MSGS_ALL, 0L, NULL, NULL, NULL, migr_check_room_msg, NULL);
}
+
void RemoveMessagesFromRooms(StrBuf *RoomNameVec, long msgnum) {
struct MetaData smi;
const char *Pos = NULL;
CtdlDeleteMessages(ChrPtr(oneRoom), &msgnum, 1, "");
};
GetMetaData(&smi, msgnum);
- TDAP_AdjRefCount(msgnum, -smi.meta_refcount);
+ AdjRefCount(msgnum, -smi.meta_refcount);
}
+
void migr_do_restore_meta(void) {
char buf[SIZ];
int failGetMessage;
}
refcount = 1;
lastnum = msgnum;
- if (prn != NULL)
+ if (prn != NULL) {
StrBufPlain(RoomNames, prn + 1, -1);
+ }
StrBufTrim(RoomNames);
}
else {
if (prn != NULL) {
- if (StrLength(RoomNames) > 0)
+ if (StrLength(RoomNames) > 0) {
StrBufAppendBufPlain(RoomNames, HKEY("|"), 0);
+ }
StrBufAppendBufPlain(RoomNames, prn, -1, 1);
StrBufTrim(RoomNames);
}
}
-
-
/******************************************************************************
* Dispatcher, Common code *
******************************************************************************/
if (CtdlAccessCheck(ac_internal)) return;
- if (CtdlTrySingleUser())
- {
+ if (CtdlTrySingleUser()) {
CtdlDisableHouseKeeping();
CtdlMakeTempFileName(migr_tempfilename1, sizeof migr_tempfilename1);
CtdlMakeTempFileName(migr_tempfilename2, sizeof migr_tempfilename2);
CtdlEnableHouseKeeping();
CtdlEndSingleUser();
}
- else
- {
+ else {
cprintf("%d The migrator is already running.\n", ERROR + RESOURCE_BUSY);
}
}
+
/******************************************************************************
* Module Hook *
******************************************************************************/