- We really should use the xmemcpy macro instead of memcpy.
/*
- * $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
/* 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);
/*
- * $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
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 */
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 */
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) {
/*
/*
- * $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
/* 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
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);
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;
}
/*
- * $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
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;
/*
- * $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
{
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 */
/*
- * $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
*
* 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;