Squid internals MemBufs (src/MemBuf.c) (ctd.) How they are used MemBufs are created by the user and then initalised through a call to memBufInit(), unlike most other data types in squid memBuf buf; memBufInit(&buf, initial-size, absolute-max) Add data to the MemBuf memBufPrintf(&buf, ...); Write the data to the socket comm_write_mbuf(fd, buf, callback, callbackdata); Clean the buffer when you are finished with it memBufClean(&buf);