Re: cvs commit: squid/src MemBuf.c

From: Andrew Bartlett <abartlet@dont-contact.us>
Date: Thu, 18 Apr 2002 15:21:11 +1000

Alex Rousskov wrote:
>
> On Thu, 18 Apr 2002, Henrik Nordstrom wrote:
>
> > What about this simple API change: A function to return a MemBuf
> > as a C string instead of accessing MemBuf->buf directly and
> > assuing it is a string as is done today in many places... This
> > function then ensures that the buffer is \0 terminated before
> > returning a char * pointer to the "string".
>
> Yes, having both terminated buf.c_str() and raw buf.data() is a good
> approach.

But if it is really RAW memory, there is a very good chance its got
nulls in it. This is certainly the case with the NTLM
challange/response stuff. In samba we have a dump_data() procedure that
takes a pointer and a length, and produces a hex-editor like dump of the
data.

Andrew Bartlett

-- 
Andrew Bartlett                                 abartlet@pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet@samba.org
Student Network Administrator, Hawker College   abartlet@hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net
Received on Wed Apr 17 2002 - 23:39:55 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:12 MST