X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fmigrate%2Fserv_migrate.c;h=f6fd819cec52bd951819722a273d5975773e599b;hb=c4bef9aed41d5709b7abbfaa92fb02a093d47024;hp=ddf52aeea170e40116d9ba22c7859289dda8aede;hpb=dbebe0b18421f635c0cded24c7194be47b03bc9d;p=citadel.git
diff --git a/citadel/modules/migrate/serv_migrate.c b/citadel/modules/migrate/serv_migrate.c
index ddf52aeea..f6fd819ce 100644
--- a/citadel/modules/migrate/serv_migrate.c
+++ b/citadel/modules/migrate/serv_migrate.c
@@ -297,8 +297,8 @@ void migr_export_message(long msgnum) {
client_write("", 23); xml_strout(smi.meta_content_type); client_write("\n", 25);
client_write("", 10);
- serialize_message(&smr, msg);
- CtdlFreeMessage(msg);
+ CtdlSerializeMessage(&smr, msg);
+ CM_Free(msg);
/* Predict the buffer size we need. Expand the buffer if necessary. */
int encoded_len = smr.len * 15 / 10 ;
@@ -442,7 +442,6 @@ void migr_do_export(void) {
cprintf("%d\n", config.c_pop3s_port);
cprintf("%d\n", config.c_smtps_port);
cprintf("%d\n", config.c_auto_cull);
- cprintf("%d\n", config.c_instant_expunge);
cprintf("%d\n", config.c_allow_spoofing);
cprintf("%d\n", config.c_journal_email);
cprintf("%d\n", config.c_journal_pubmsgs);
@@ -676,7 +675,6 @@ void migr_xml_end(void *data, const char *el) {
else if (!strcasecmp(el, "c_pop3s_port")) config.c_pop3s_port = atoi(migr_chardata);
else if (!strcasecmp(el, "c_smtps_port")) config.c_smtps_port = atoi(migr_chardata);
else if (!strcasecmp(el, "c_auto_cull")) config.c_auto_cull = atoi(migr_chardata);
- else if (!strcasecmp(el, "c_instant_expunge")) config.c_instant_expunge = atoi(migr_chardata);
else if (!strcasecmp(el, "c_allow_spoofing")) config.c_allow_spoofing = atoi(migr_chardata);
else if (!strcasecmp(el, "c_journal_email")) config.c_journal_email = atoi(migr_chardata);
else if (!strcasecmp(el, "c_journal_pubmsgs")) config.c_journal_pubmsgs = atoi(migr_chardata);
@@ -891,12 +889,12 @@ void migr_xml_end(void *data, const char *el) {
* Import begins here
*/
void migr_do_import(void) {
- char buf[SIZ];
+ StrBuf *Buf;
XML_Parser xp;
int linelen;
unbuffer_output();
-
+ Buf = NewStrBufPlain(NULL, SIZ);
xp = XML_ParserCreate(NULL);
if (!xp) {
cprintf("%d Failed to create XML parser instance\n", ERROR+INTERNAL_ERROR);
@@ -910,22 +908,22 @@ void migr_do_import(void) {
cprintf("%d sock it to me\n", SEND_LISTING);
unbuffer_output();
- while (client_getln(buf, sizeof buf) >= 0 && strcmp(buf, "000")) {
- linelen = strlen(buf);
- strcpy(&buf[linelen++], "\n");
+ while (CtdlClientGetLine(Buf) >= 0 && strcmp(ChrPtr(Buf), "000")) {
+ linelen = StrLength(Buf);
+ StrBufAppendBufPlain(Buf, HKEY("\n"), 0);
if (server_shutting_down)
break; // Should we break or return?
- if (buf[0] == '\0')
+ if (linelen == 0)
continue;
- XML_Parse(xp, buf, linelen, 0);
+ XML_Parse(xp, ChrPtr(Buf), linelen, 0);
}
XML_Parse(xp, "", 0, 1);
XML_ParserFree(xp);
-
+ FreeStrBuf(&Buf);
rebuild_euid_index();
rebuild_usersbynumber();
CC->dont_term = 0;