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; i<strlen(buf); ++i) {
+ for (i=0; buf[i]; ++i) {
if (isspace(buf[i])) buf[i]='_';
buf[i] = tolower(buf[i]);
}
snprintf(msg->cm_fields['R'], 256,
"room_%s@%s", CC->room.QRname,
config.c_fqdn);
- for (i=0; i<strlen(msg->cm_fields['R']); ++i) {
+ for (i=0; msg->cm_fields['R'][i]; ++i) {
if (isspace(msg->cm_fields['R'][i])) {
msg->cm_fields['R'][i] = '_';
}
snprintf(msg->cm_fields['F'], SIZ,
"room_%s@%s", CC->room.QRname,
config.c_fqdn);
- for (i=0; i<strlen(msg->cm_fields['F']); ++i) {
+ for (i=0; msg->cm_fields['F'][i]; ++i) {
if (isspace(msg->cm_fields['F'][i])) {
msg->cm_fields['F'][i] = '_';
}
/* 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; i<strlen(buf); ++i) {
+ for (i=0; buf[i]; ++i) {
buf[i] = tolower(buf[i]);
if (isspace(buf[i])) buf[i] = '_';
}
* connected that it's inevitable.)
*/
if (network_usetable(msg) != 0) {
+ CtdlFreeMessage(msg);
return;
}
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,
CtdlRegisterProtoHook(cmd_nsyn, "NSYN", "Synchronize room to node");
CtdlRegisterSessionHook(network_do_queue, EVT_TIMER);
CtdlRegisterRoomHook(network_room_handler);
+ CtdlRegisterCleanupHook(destroy_network_queue_room);
+
/* return our Subversion id for the Log */
return "$Id$";