From: Art Cancro Date: Fri, 5 Mar 2010 21:19:07 +0000 (+0000) Subject: * New parameter to CtdlSaveMsgPointersInRoom() to suppress the reference count adjust... X-Git-Tag: v7.86~336 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=182f984f6f03067f40a7e01bfa82df95f5605358 * New parameter to CtdlSaveMsgPointersInRoom() to suppress the reference count adjustment. To be used ONLY when we're going to rewrite the metadata manually. Used ONLY by serv_migrate. Everyone else HANDS OFF. --- diff --git a/citadel/citserver.c b/citadel/citserver.c index f371d6bf5..603d34982 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -3,21 +3,21 @@ * * Main source module for the Citadel server * - * Copyright (c) 1987-2009 by the citadel.org team + * Copyright (c) 1987-2010 by the citadel.org team * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -29,7 +29,6 @@ #include #include - #if TIME_WITH_SYS_TIME # include # include @@ -82,7 +81,6 @@ #include "ctdl_module.h" - char *unique_session_numbers; int ScheduledShutdown = 0; time_t server_startup_time; diff --git a/citadel/modules/imap/imap_misc.c b/citadel/modules/imap/imap_misc.c index 496174a42..dbd224ff7 100644 --- a/citadel/modules/imap/imap_misc.c +++ b/citadel/modules/imap/imap_misc.c @@ -1,23 +1,21 @@ /* * $Id$ * + * Copyright (c) 1987-2010 by the citadel.org team * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * Copyright (c) 2001-2009 by the citadel.org team + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -100,7 +98,7 @@ int imap_do_copy(const char *destination_folder) { } if (num_selected > 0) { - CtdlSaveMsgPointersInRoom(roomname, selected_msgs, num_selected, 1, NULL); + CtdlSaveMsgPointersInRoom(roomname, selected_msgs, num_selected, 1, NULL, 0); } free(selected_msgs); diff --git a/citadel/modules/migrate/serv_migrate.c b/citadel/modules/migrate/serv_migrate.c index e570381f5..cf8512916 100644 --- a/citadel/modules/migrate/serv_migrate.c +++ b/citadel/modules/migrate/serv_migrate.c @@ -1,14 +1,14 @@ /* * $Id$ * - * Copyright (c) 2000-2009 by the citadel.org development team - * * This module dumps and/or loads the Citadel database in XML format. * + * Copyright (c) 1987-2010 by the citadel.org team + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -17,9 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -797,7 +795,7 @@ void migr_xml_end(void *data, const char *el) { } } if (msgcount > 0) { - CtdlSaveMsgPointersInRoom(FRname, msglist, msgcount, 0, NULL); + CtdlSaveMsgPointersInRoom(FRname, msglist, msgcount, 0, NULL, 1); } free(msglist); msglist = NULL; diff --git a/citadel/modules/newuser/serv_newuser.c b/citadel/modules/newuser/serv_newuser.c index afa5f47ae..431d433df 100644 --- a/citadel/modules/newuser/serv_newuser.c +++ b/citadel/modules/newuser/serv_newuser.c @@ -1,24 +1,24 @@ /* * $Id$ * - * Automaticalyl copies the contents of a "New User Greetings" room to the + * Automatically copies the contents of a "New User Greetings" room to the * inbox of any new user upon account creation. * - * Copyright (c) 1987-2009 by the citadel.org team + * Copyright (c) 1987-2010 by the citadel.org team * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* @@ -101,7 +101,7 @@ void CopyNewUserGreetings(void) { } if (num_msgs > 0) { - CtdlSaveMsgPointersInRoom(mailboxname, msglist, num_msgs, 1, NULL); + CtdlSaveMsgPointersInRoom(mailboxname, msglist, num_msgs, 1, NULL, 0); } /* Now free the memory we used, and go away. */ diff --git a/citadel/modules/sieve/serv_sieve.c b/citadel/modules/sieve/serv_sieve.c index 9de59d916..88c72e994 100644 --- a/citadel/modules/sieve/serv_sieve.c +++ b/citadel/modules/sieve/serv_sieve.c @@ -4,21 +4,21 @@ * This module glues libSieve to the Citadel server in order to implement * the Sieve mailbox filtering language (RFC 3028). * - * Copyright (c) 2007-2009 by the citadel.org team + * Copyright (c) 1987-2010 by the citadel.org team * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -193,7 +193,7 @@ int ctdl_fileinto(sieve2_context_t *s, void *my) /* Yes, we actually have to go there */ CtdlUserGoto(NULL, 0, 0, NULL, NULL); - c = CtdlSaveMsgPointersInRoom(NULL, &cs->msgnum, 1, 0, NULL); + c = CtdlSaveMsgPointersInRoom(NULL, &cs->msgnum, 1, 0, NULL, 0); /* Go back to the room we came from */ if (strcasecmp(original_room_name, CC->room.QRname)) { diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 429f17a8b..98510111a 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -2,22 +2,22 @@ * $Id$ * * Implements the message store. - * + * * Copyright (c) 1987-2010 by the citadel.org team * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sysdep.h" @@ -2367,8 +2367,8 @@ void cmd_dlat(char *cmdbuf) * this mode of operation only works if we're saving a single message.) */ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newmsgs, - int do_repl_check, struct CtdlMessage *supplied_msg) -{ + int do_repl_check, struct CtdlMessage *supplied_msg, int suppress_refcount_adj +) { int i, j, unique; char hold_rm[ROOMNAMELEN]; struct cdbdata *cdbfr; @@ -2383,8 +2383,9 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms int num_msgs_to_be_merged = 0; CtdlLogPrintf(CTDL_DEBUG, - "CtdlSaveMsgPointersInRoom(room=%s, num_msgs=%d, repl=%d)\n", - roomname, num_newmsgs, do_repl_check); + "CtdlSaveMsgPointersInRoom(room=%s, num_msgs=%d, repl=%d, suppress_rca=%d)\n", + roomname, num_newmsgs, do_repl_check, suppress_refcount_adj + ); strcpy(hold_rm, CC->room.QRname); @@ -2505,8 +2506,10 @@ int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newms CtdlGetRoom(&CC->room, hold_rm); /* Bump the reference count for all messages which were merged */ - for (i=0; isock, &read_fd); ret = select(ipc->sock+1, &read_fd, NULL, NULL, &tv); - err = errno; - if (err!=0) - printf("select failed: %d", err); - if (ret == -1) { if (!(errno == EINTR || errno == EAGAIN)) - printf("select failed: %d", err); - return 1; + fprintf(stderr, "select() failed: %s", strerror(errno)); + return(1); } if (ret != 0) { @@ -283,7 +291,7 @@ int main(int argc, char **argv) n = read(ipc->sock, rbuf, SIZ); if (n>0) { rbuf[n]='\0'; - fprintf (stderr, rbuf); + fprintf(stderr, rbuf); fflush (stdout); } }