You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2010/12/03 18:58:10 UTC
[jira] Created: (TS-581) Doc changes for no NULL terminated
strings, and one API rename
Doc changes for no NULL terminated strings, and one API rename
--------------------------------------------------------------
Key: TS-581
URL: https://issues.apache.org/jira/browse/TS-581
Project: Traffic Server
Issue Type: Bug
Components: Documentation
Reporter: Leif Hedstrom
Fix For: 3.0
We have eliminated the code that allowed a few APIs to assume that strings were NULL terminated, when we really don't make any such promises. Below is the list of APIs that are affected, we should make sure all documentation makes a point that the strings are not NULL terminated, and that the length pointer argument must not be NULL. In particular these two APIs have the wrong (old) documentation:
INKHttpHdrMethodGet()
INKMimeHdrFieldValueStringGet()
-- Leif
const char * TSUrlSchemeGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlUserGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlPasswordGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHostGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlPathGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHttpParamsGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHttpQueryGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSUrlHttpFragmentGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSMimeHdrFieldNameGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int *length);
const char *TSHttpHdrMethodGet(TSMBuffer bufp, TSMLoc obj, int *length);
const char *TSHttpHdrReasonGet(TSMBuffer bufp, TSMLoc obj, int *length);
TSReturnCode TSMimeHdrFieldValueStringGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char **value_ptr, int *value_len_ptr);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TS-581) Doc changes for no NULL terminated
strings, and one API rename
Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TS-581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12967251#action_12967251 ]
Leif Hedstrom commented on TS-581:
----------------------------------
We should also point out that all these APIs for returning strings (the ones mentioned here, and any other, except the GetURL() APIs) has the same "lease" semantics as the TSMLoc handles. This means you can't expect a string from these APIs to be usable after a TxnReenable has been issued. There should be remarks for this on the MLocs, so we should use the same text for the string APIs.
> Doc changes for no NULL terminated strings, and one API rename
> --------------------------------------------------------------
>
> Key: TS-581
> URL: https://issues.apache.org/jira/browse/TS-581
> Project: Traffic Server
> Issue Type: Bug
> Components: Documentation
> Reporter: Leif Hedstrom
> Fix For: 3.0
>
>
> We have eliminated the code that allowed a few APIs to assume that strings were NULL terminated, when we really don't make any such promises. Below is the list of APIs that are affected, we should make sure all documentation makes a point that the strings are not NULL terminated, and that the length pointer argument must not be NULL. In particular these two APIs have the wrong (old) documentation:
> INKHttpHdrMethodGet()
> INKMimeHdrFieldValueStringGet()
> -- Leif
> const char * TSUrlSchemeGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSUrlUserGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSUrlPasswordGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSUrlHostGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSUrlPathGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSUrlHttpParamsGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSUrlHttpQueryGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSUrlHttpFragmentGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSMimeHdrFieldNameGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int *length);
> const char *TSHttpHdrMethodGet(TSMBuffer bufp, TSMLoc obj, int *length);
> const char *TSHttpHdrReasonGet(TSMBuffer bufp, TSMLoc obj, int *length);
> TSReturnCode TSMimeHdrFieldValueStringGet(TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char **value_ptr, int *value_len_ptr);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.