[
https://issues.apache.org/jira/browse/TS-3726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15358590#comment-15358590
]
ASF GitHub Bot commented on TS-3726:
------------------------------------
Github user alhonen commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/772#discussion_r69261710
--- Diff: proxy/api/ts/ts.h ---
@@ -2336,6 +2336,35 @@ tsapi uint64_t TSHttpTxnIdGet(TSHttpTxn txnp);
tsapi TSReturnCode TSBase64Decode(const char *str, size_t str_len,
unsigned char *dst, size_t dst_size, size_t *length);
tsapi TSReturnCode TSBase64Encode(const char *str, size_t str_len, char
*dst, size_t dst_size, size_t *length);
+/* Expose internal build_error_response function */
+/**
+ This method sets the requires state for an error reply, including
+ the error text, status code, reason phrase, and reply headers.
+
+ The caller calls the method with the TSHttpTxn <txnp>, the
+ HTTP status code <status_code>, a user-specified reason phrase
+ string (or NULL) <reason_phrase_or_null>, and a printf-like
+ text format and arguments which are appended to the error text.
+
+ @param txnp the transaction pointer
+ @param status_code the HTTP status code
+ @param reason_phrase_or_null a user-specified reason phrase string. If
it
+ is NULL, the default HTTP reason phrase is used.
+ @param error_body_type the error message type, as specified by the
HttpBodyFactory
+ customized error page system. Get the list by command:
+ "ls -al etc/trafficserver/body_factory/default/"
+
+ @param format If it is not NULL or "", it is also added to the error
text
+ body as descriptive text in the error body.
+
+ @note reference from build_error_response:
+ This routine DOES NOT check for buffer overflows. The caller
should keep
--- End diff --
Do we really want to expose build_error_response() as long as this is the
case?
> Expose build_error_response in order to making a formated error response in
> plugin
> ----------------------------------------------------------------------------------
>
> Key: TS-3726
> URL: https://issues.apache.org/jira/browse/TS-3726
> Project: Traffic Server
> Issue Type: New Feature
> Components: TS API
> Reporter: Oknet Xu
> Assignee: Oknet Xu
> Labels: API, review
> Fix For: 7.0.0
>
> Attachments: TSHttpTxnErrorpageSet.patch
>
>
> expose build_error_response in order to making a formated error response in
> plugin.
> ATS support multi-language error response page by body_factory.
> In the ATS internal, build_error_response used to generating it.
> I wrote a patch to expose build_error_response function for plugin.
> and modified example/basic_auth for a sample usage.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)