Hi Acacio,

Is m_http_sm->get_uuid() guaranteed to be null terminated?

Thanks,

Sudheer

On 10/8/14, 11:43 AM, "Acácio Centeno" <acacio.cent...@azion.com> wrote:

>Hello,
>
>I've written the following function to log our internal UUID to
>access.log:
>
>int
>LogAccessHttp::marshal_proxy_uuid(char *buf)
>{
>  const char *str = NULL;
>  int len = INK_MIN_ALIGN;
>
>  if (buf) {
>    if ( m_http_sm->magic == HTTP_SM_MAGIC_ALIVE ) {
>      str = m_http_sm->get_uuid();
>    } else {
>      str = "-";
>    }
>    len = LogAccess::strlen(str);
>    Debug("Azion", "Logando UUID [%d:%s]", len, str);
>    marshal_str(buf, str, len);
>  }
>  return len;
>}
>
>The debug message always logs 40 for the length and the correct UUID,
>however, on production, sometimes it logs the correct information,
>sometimes it logs garbage like:
>
>7022d7ceH�5T
>1534af18I�5T
>3bbb55ccK�5T
>f3a9bcf5R�5T
>
>(Notice that the last 3 bytes are always the same)
>
>Is there any gotcha I should be aware of when printing the log? Am I doing
>something wrong on the serializer?
>
>Best regards,
>Acácio Centeno
>Software Engineering
>Azion Technologies
>Porto Alegre, Brasil +55 51 3012 3005 | +55 51 8118 9947
>Miami, USA +1 305 704 8816
>
>Quaisquer informações contidas neste e-mail e anexos podem ser
>confidenciais e privilegiadas, protegidas por sigilo legal. Qualquer forma
>de utilização deste documento depende de autorização do emissor, sujeito
>as
>penalidades cabíveis.
>
>Any information in this e-mail and attachments may be confidential and
>privileged, protected by legal confidentiality. The use of this document
>require authorization by the issuer, subject to penalties.

Reply via email to