[Common-dev] Re: CR Bug 14035. Fix for ipv6 Bind,DoRead.

[Common-dev] Re: CR Bug 14035. Fix for ipv6 Bind,DoRead.

Tom Marshall tmarshall at helixcommunity.org
Wed Aug 3 19:16:49 PDT 2005


On Wed, Aug 03, 2005 at 06:37:18PM -0700, Sujeet Kharkar wrote:
> At 09:29 AM 8/3/2005 -0700, Sujeet Kharkar wrote:
> 
> Please see the attached diff. (Only included the part, which have not yet been
> CR)
> 
> This takes advantage of the fact that IPv6 addresses may only be
> HX_ADDRSTRLEN_IN6 octets as suggested by Tommy and also avoids a memcpy when no
> % is specified.

Looks pretty good.  Just some minor comments...

> @@ -695,14 +695,45 @@
>  STDMETHODIMP
>  CHXSockAddrIN6::SetAddr(IHXBuffer* pBuf)
>  {
> +    HX_RESULT res = HXR_OK;
>      HX_ASSERT(m_nRefCount == 1);
>      HX_ASSERT(pBuf != NULL && pBuf->GetBuffer() != NULL);
>      HX_ASSERT(*(pBuf->GetBuffer()+pBuf->GetSize()-1) == 0);
> -    if (hx_inet_pton(AF_INET6, (const char*)pBuf->GetBuffer(), &m_addr.sin6_addr) <= 0)
> +
> +    char szBareAddr[HX_ADDRSTRLEN_IN6];
> +    char* pszBareAddr = NULL;
> +    char* pszIPV6Addr = (char*)pBuf->GetBuffer();
> +
> +    CHAR* pscopeid_delimiter = strchr((const char*)pszIPV6Addr,'%');

What is the difference between char and CHAR?

> +    if ( pscopeid_delimiter )

This file uses the server coding style with no space inside the parens. 
Could you match that for this change?

> +	szBareAddr[ulBytesToCopy] = NULL;

The rhs on this assignment should be '\0'.

-- 
Paranoid Club meeting this Friday.  Now ... just try to find out where!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.helixcommunity.org/pipermail/common-dev/attachments/20050803/39d5ed59/attachment.bin


More information about the Common-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.