Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 255E0200B40 for ; Fri, 1 Jul 2016 09:48:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 23F4A160A61; Fri, 1 Jul 2016 07:48:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6CEC0160A5D for ; Fri, 1 Jul 2016 09:48:38 +0200 (CEST) Received: (qmail 16324 invoked by uid 500); 1 Jul 2016 07:48:37 -0000 Mailing-List: contact dev-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@trafficserver.apache.org Delivered-To: mailing list dev@trafficserver.apache.org Received: (qmail 16312 invoked by uid 99); 1 Jul 2016 07:48:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2016 07:48:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 15CDBE947E; Fri, 1 Jul 2016 07:48:37 +0000 (UTC) From: alhonen To: dev@trafficserver.apache.org Reply-To: dev@trafficserver.apache.org References: In-Reply-To: Subject: [GitHub] trafficserver pull request #772: TS-3726: Expose build_error_response Content-Type: text/plain Message-Id: <20160701074837.15CDBE947E@git1-us-west.apache.org> Date: Fri, 1 Jul 2016 07:48:37 +0000 (UTC) archived-at: Fri, 01 Jul 2016 07:48:39 -0000 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 , the + HTTP status code , a user-specified reason phrase + string (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? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---