Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / util / server_mst.c
index 6ef43275661e2b65bb84f8ed58be639d222fa18c..5155b54dacc26fc3939f77f328047dd50d03584f 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2010 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2010 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -34,7 +34,7 @@
 #define ALIGN_FACTOR 8
 #endif
 
-#define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
+#define LOG(kind,...) GNUNET_log_from (kind, "util-server-mst", __VA_ARGS__)
 
 
 /**
@@ -49,12 +49,12 @@ struct GNUNET_SERVER_MessageStreamTokenizer
   GNUNET_SERVER_MessageTokenizerCallback cb;
 
   /**
-   * Closure for cb.
+   * Closure for @e cb.
    */
   void *cb_cls;
 
   /**
-   * Size of the buffer (starting at 'hdr').
+   * Size of the buffer (starting at @e hdr).
    */
   size_t curr_buf;
 
@@ -152,7 +152,7 @@ do_align:
       delta =
           GNUNET_MIN (sizeof (struct GNUNET_MessageHeader) -
                       (mst->pos - mst->off), size);
-      memcpy (&ibuf[mst->pos], buf, delta);
+      GNUNET_memcpy (&ibuf[mst->pos], buf, delta);
       mst->pos += delta;
       buf += delta;
       size -= delta;
@@ -194,7 +194,7 @@ do_align:
     {
       delta = GNUNET_MIN (want - (mst->pos - mst->off), size);
       GNUNET_assert (mst->pos + delta <= mst->curr_buf);
-      memcpy (&ibuf[mst->pos], buf, delta);
+      GNUNET_memcpy (&ibuf[mst->pos], buf, delta);
       mst->pos += delta;
       buf += delta;
       size -= delta;
@@ -244,7 +244,7 @@ do_align:
       want = ntohs (hdr->size);
       if (want < sizeof (struct GNUNET_MessageHeader))
       {
-        GNUNET_break_op (0);
+       GNUNET_break_op (0);
         mst->off = 0;
         return GNUNET_SYSERR;
       }
@@ -281,7 +281,7 @@ copy:
       mst->curr_buf = size + mst->pos;
     }
     GNUNET_assert (size + mst->pos <= mst->curr_buf);
-    memcpy (&ibuf[mst->pos], buf, size);
+    GNUNET_memcpy (&ibuf[mst->pos], buf, size);
     mst->pos += size;
   }
   if (purge)