]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Tue, 16 May 2000 13:09:33 +0000 (13:09 +0000)
committerwessels <>
Tue, 16 May 2000 13:09:33 +0000 (13:09 +0000)
 - We really should use the xmemcpy macro instead of memcpy.

src/MemBuf.cc
src/acl.cc
src/fs/coss/store_io_coss.cc
src/http.cc
src/stat.cc
src/test_cache_digest.cc

index 2c2d8814314cc9ea9b58d32d99d577a61bb79d0d..cd7163035db02995fca6e1c6ae7825a693d047bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: MemBuf.cc,v 1.23 2000/03/06 16:23:28 wessels Exp $
+ * $Id: MemBuf.cc,v 1.24 2000/05/16 07:09:33 wessels Exp $
  *
  * DEBUG: section 59    auto-growing Memory Buffer with printf
  * AUTHOR: Alex Rousskov
@@ -332,7 +332,7 @@ memBufGrow(MemBuf * mb, mb_size_t min_cap)
 
     /* copy and free old buffer if needed */
     if (old_mb.buf && old_mb.freefunc) {
-       memcpy(mb->buf, old_mb.buf, old_mb.size);
+       xmemcpy(mb->buf, old_mb.buf, old_mb.size);
        (*old_mb.freefunc) (old_mb.buf);
     } else {
        assert(!old_mb.buf && !old_mb.freefunc);
index 1c289dd37fe268b309fcc64dd70d92863d4e43e4..13d76a3287745cefe78b4ff8a38cc2e3d641ca81 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.cc,v 1.218 2000/05/12 00:29:06 wessels Exp $
+ * $Id: acl.cc,v 1.219 2000/05/16 07:09:33 wessels Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -2419,7 +2419,7 @@ aclMatchArp(void *dataptr, struct in_addr c)
     ipAddr.sin_port = 0;
     ipAddr.sin_addr = c;
     memset(&arpReq, '\0', sizeof(arpReq));
-    memcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
+    xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
     /* Query ARP table */
     if (ioctl(HttpSockets[0], SIOCGARP, &arpReq) != -1) {
        /* Skip non-ethernet interfaces */
@@ -2465,7 +2465,7 @@ aclMatchArp(void *dataptr, struct in_addr c)
        ipAddr.sin_port = 0;
        ipAddr.sin_addr = c;
        memset(&arpReq, '\0', sizeof(arpReq));
-       memcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
+       xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
        strncpy(arpReq.arp_dev, ifr->ifr_name, sizeof(arpReq.arp_dev) - 1);
        arpReq.arp_dev[sizeof(arpReq.arp_dev) - 1] = '\0';
        /* Query ARP table */
@@ -2522,7 +2522,7 @@ aclMatchArp(void *dataptr, struct in_addr c)
     ipAddr.sin_port = 0;
     ipAddr.sin_addr = c;
     memset(&arpReq, '\0', sizeof(arpReq));
-    memcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
+    xmemcpy(&arpReq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
     /* Query ARP table */
     if (ioctl(HttpSockets[0], SIOCGARP, &arpReq) != -1) {
        /*
index d6ff2e817cf9cd7fc4914b858887c5cfdd9ad06c..d361a269a5dd96aafc3faeac53e7fbe2f95d4e88 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_coss.cc,v 1.2 2000/05/12 00:29:19 wessels Exp $
+ * $Id: store_io_coss.cc,v 1.3 2000/05/16 07:09:36 wessels Exp $
  *
  * DEBUG: section 81    Storage Manager COSS Interface
  * AUTHOR: Eric Stern
@@ -198,7 +198,7 @@ storeCossOpen(SwapDir * SD, StoreEntry * e, STFNCB * file_callback,
     /* make local copy so we don't have to lock membuf */
     if (p) {
        cstate->readbuffer = xmalloc(sio->st_size);
-       memcpy(cstate->readbuffer, p, sio->st_size);
+       xmemcpy(cstate->readbuffer, p, sio->st_size);
     } else {
        /* Do the allocation */
        /* this is the first time we've been called on a new sio
@@ -303,7 +303,7 @@ storeCossWrite(SwapDir * SD, storeIOState * sio, char *buf, size_t size, off_t o
     diskoffset = sio->swap_filen + sio->offset;
     dest = storeCossMemPointerFromDiskOffset(SD, diskoffset, &membuf);
     assert(dest != NULL);
-    memcpy(dest, buf, size);
+    xmemcpy(dest, buf, size);
     sio->offset += size;
     if (free_func)
        (free_func) (buf);
@@ -333,11 +333,11 @@ storeCossReadDone(int fd, const char *buf, int len, int errflag, void *my_data)
        if (cstate->readbuffer == NULL) {
            cstate->readbuffer = xmalloc(sio->st_size);
            p = storeCossMemPointerFromDiskOffset(SD, sio->swap_filen, NULL);
-           memcpy(cstate->readbuffer, p, sio->st_size);
+           xmemcpy(cstate->readbuffer, p, sio->st_size);
            storeCossMemBufUnlock(SD, sio);
        }
        sio->offset += len;
-       memcpy(cstate->requestbuf, &cstate->readbuffer[cstate->requestoffset],
+       xmemcpy(cstate->requestbuf, &cstate->readbuffer[cstate->requestoffset],
            cstate->requestlen);
        rlen = (size_t) cstate->requestlen;
     }
index 8e5f4a9f96eb23a5abfea50e146b61215236b49f..ac514c1c9b923207dba3003aa788c5007163d5a0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.361 2000/05/16 07:06:04 wessels Exp $
+ * $Id: http.cc,v 1.362 2000/05/16 07:09:34 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -329,7 +329,7 @@ httpProcessReplyHeader(HttpStateData * httpState, const char *buf, int size)
     assert(httpState->reply_hdr_state == 0);
     hdr_len = httpState->reply_hdr_size;
     room = 8191 - hdr_len;
-    memcpy(httpState->reply_hdr + hdr_len, buf, room < size ? room : size);
+    xmemcpy(httpState->reply_hdr + hdr_len, buf, room < size ? room : size);
     hdr_len += room < size ? room : size;
     httpState->reply_hdr[hdr_len] = '\0';
     httpState->reply_hdr_size = hdr_len;
index a32a5cb3a6f3eb196fb36c307ae346b156ddd77f..7af228f63d1fe030269c310b10f675da37aec0e3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.327 2000/05/12 00:29:08 wessels Exp $
+ * $Id: stat.cc,v 1.328 2000/05/16 07:09:34 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -970,7 +970,7 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig)
 {
     assert(dest && orig);
     /* this should take care of all the fields, but "special" ones */
-    memcpy(dest, orig, sizeof(*dest));
+    xmemcpy(dest, orig, sizeof(*dest));
     /* prepare space where to copy special entries */
     statCountersInitSpecial(dest);
     /* now handle special cases */
index 3f3d52c3c4f172f1afa9720242ae7044c15d1fa4..849eac1fb6d0ca47d7e0821008f73e0b4318e320 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: test_cache_digest.cc,v 1.24 2000/03/06 16:23:36 wessels Exp $
+ * $Id: test_cache_digest.cc,v 1.25 2000/05/16 07:09:34 wessels Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -436,7 +436,7 @@ accessLogReader(FileIterator * fi)
  * strcmp(hier, "SSL_PARENT_MISS") &&
  * strcmp(hier, "DEFAULT_PARENT");
  */
-    memcpy(entry->key, storeKeyPublic(url, method_id), sizeof(entry->key));
+    xmemcpy(entry->key, storeKeyPublic(url, method_id), sizeof(entry->key));
     /*fprintf(stdout, "%s:%d: %s %s %s %s\n",
      * fname, count, method, storeKeyText(entry->key), url, hier); */
     return frOk;