buf->total_in += added;
unsigned int buffer_adddata(buffer_t *buf, const unsigned char *ptr,		unsigned int size){	unsigned int added = MAX_DATA_SIZE - buf->used;	if(added > size)		added = size;	if(added == 0)		return 0;	memcpy(buf->data + buf->used, ptr, added);	buf->used += added;	return added;}