]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/network/serv_network.c
Patches from Matt with slight mod from me to do without strlen. Also modified lprintf...
[citadel.git] / citadel / modules / network / serv_network.c
index 8ceba0d11bc93ff412056cf93f4b896624d9b604..29ad8379bdf78ef1045f23b98f7e08bebb78e189 100644 (file)
@@ -454,7 +454,7 @@ void network_deliver_digest(struct SpoolControl *sc) {
        snprintf(buf, sizeof buf, "[%s]", CC->room.QRname);
        msg->cm_fields['U'] = strdup(buf);
        sprintf(buf, "room_%s@%s", CC->room.QRname, config.c_fqdn);
-       for (i=0; !IsEmptyStr(&buf[i]); ++i) {
+       for (i=0; buf[i]; ++i) {
                if (isspace(buf[i])) buf[i]='_';
                buf[i] = tolower(buf[i]);
        }
@@ -612,7 +612,7 @@ void network_spool_msg(long msgnum, void *userdata) {
                        snprintf(msg->cm_fields['R'], 256,
                                "room_%s@%s", CC->room.QRname,
                                config.c_fqdn);
-                       for (i=0; !IsEmptyStr(&msg->cm_fields['R'][i]); ++i) {
+                       for (i=0; msg->cm_fields['R'][i]; ++i) {
                                if (isspace(msg->cm_fields['R'][i])) {
                                        msg->cm_fields['R'][i] = '_';
                                }
@@ -702,7 +702,7 @@ void network_spool_msg(long msgnum, void *userdata) {
                                snprintf(msg->cm_fields['F'], SIZ,
                                        "room_%s@%s", CC->room.QRname,
                                        config.c_fqdn);
-                               for (i=0; !IsEmptyStr(&msg->cm_fields['F'][i]); ++i) {
+                               for (i=0; msg->cm_fields['F'][i]; ++i) {
                                        if (isspace(msg->cm_fields['F'][i])) {
                                                msg->cm_fields['F'][i] = '_';
                                        }
@@ -973,7 +973,7 @@ void network_spoolout_room(char *room_to_spool) {
        /* If we wrote a digest, deliver it and then close it */
        snprintf(buf, sizeof buf, "room_%s@%s",
                CC->room.QRname, config.c_fqdn);
-       for (i=0; !IsEmptyStr(&buf[i]); ++i) {
+       for (i=0; buf[i]; ++i) {
                buf[i] = tolower(buf[i]);
                if (isspace(buf[i])) buf[i] = '_';
        }
@@ -1435,6 +1435,7 @@ void network_process_buffer(char *buffer, long size) {
         * connected that it's inevitable.)
         */
        if (network_usetable(msg) != 0) {
+               CtdlFreeMessage(msg);
                return;
        }
 
@@ -1706,9 +1707,9 @@ void receive_spool(int sock, char *remote_nodename) {
                return;
        }
        if (download_len > 0)
-               lprintf(CTDL_NOTICE, "Received %ld octets from <%s>",
+               lprintf(CTDL_NOTICE, "Received %ld octets from <%s>\n",
                                download_len, remote_nodename);
-       lprintf(CTDL_DEBUG, "%s", buf);
+       lprintf(CTDL_DEBUG, "%s\n", buf);
        /* TODO: make move inline. forking is verry expensive. */
        snprintf(buf, 
                         sizeof buf,