]> code.citadel.org Git - citadel.git/commitdiff
* More work on the new networker.
authorArt Cancro <ajc@citadel.org>
Wed, 29 Aug 2001 02:51:25 +0000 (02:51 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 29 Aug 2001 02:51:25 +0000 (02:51 +0000)
citadel/ChangeLog
citadel/serv_network.c

index d65ee071bc89b3db6a2f66d677681e64d9739434..d14aa4aa946d981628a2be7c1355161f29b17e3b 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 580.29  2001/08/29 02:51:25  ajc
+ * More work on the new networker.
+
  Revision 580.28  2001/08/25 05:04:57  ajc
  * Worked a little more on the in-server replacement for netproc
 
@@ -2698,3 +2701,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index 4900ee8c997b7aa650a485d0b3cbc040778b82a8..92a92fde15f739208420186acf3079a9dc9ef645 100644 (file)
@@ -413,9 +413,58 @@ void network_queue_room(struct quickroom *qrbuf, void *data) {
  * from the inbound queue 
  */
 void network_process_buffer(char *buffer, long size) {
+       struct CtdlMessage *msg;
+       long pos;
+       int field;
+       int a, e;
+       struct usersupp tempUS;
+       char recp[SIZ];
+
+        msg = (struct CtdlMessage *) mallok(sizeof(struct CtdlMessage));
+        memset(msg, 0, sizeof(struct CtdlMessage));
+        msg->cm_magic = CTDLMESSAGE_MAGIC;
+        msg->cm_anon_type = buffer[1];
+        msg->cm_format_type = buffer[2];
+
+       for (pos = 3; pos < size; ++pos) {
+               field = buffer[pos];
+               msg->cm_fields[field] = strdoop(&buffer[pos+1]);
+               pos = pos + strlen(&buffer[(int)pos]);
+       }
+
+       /* Check for message routing */
+       if (msg->cm_fields['D'] != NULL) {
+               if (strcasecmp(msg->cm_fields['D'], config.c_nodename)) {
+
+                       /* FIXME route the message, stupid */
+
+               }
+       }
+
+       /* Does it have a recipient?  If so, validate it... */
+       if (msg->cm_fields['D'] != NULL) {
+
+               safestrncpy(recp, msg->cm_fields['D'], sizeof(recp));
+
+                e = alias(recp);        /* alias and mail type */
+                if ((recp[0] == 0) || (e == MES_ERROR)) {
+
+                       /* FIXME bounce the msg */
+
+                }
+                else if (e == MES_LOCAL) {
+                        a = getuser(&tempUS, recp);
+                        if (a != 0) {
+
+                               /* FIXME bounce the msg */
+
+                        }
+                }
+        }
 
        /* FIXME ... do something with it! */
 
+       CtdlFreeMessage(msg);
 }