You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/07/13 07:31:14 UTC

[1/2] git commit: doc: add TSHttpParserCreate to sphinx API reference

Updated Branches:
  refs/heads/master 7b7979c01 -> 30d0925c0


doc: add TSHttpParserCreate to sphinx API reference


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a848aca7
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a848aca7
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a848aca7

Branch: refs/heads/master
Commit: a848aca764382c1402441b827d3104cf7a7f6006
Parents: 7b7979c
Author: James Peach <jp...@apache.org>
Authored: Fri Jul 12 22:04:52 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Jul 12 22:04:52 2013 -0700

----------------------------------------------------------------------
 doc/conf.py                           |  1 +
 doc/sdk/man/TSHttpParserCreate.en.rst | 90 ++++++++++++++++++++++++++++++
 doc/sdk/man/index.en.rst              |  1 +
 3 files changed, 92 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a848aca7/doc/conf.py
----------------------------------------------------------------------
diff --git a/doc/conf.py b/doc/conf.py
index 82212a9..2c6540c 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -216,6 +216,7 @@ man_pages = [
     ('sdk/man/TSAPI.en', 'TSAPI', u'Introduction to the Apache Traffic Server API', None, u'3ts'),
     ('sdk/man/TSDebug.en', 'TSDebug', u'Traffic Server Debugging APIs', None, u'3ts'),
     ('sdk/man/TSHttpHookAdd.en', 'TSHttpHookAdd', u'Intercept Traffic Server events', None, u'3ts'),
+    ('sdk/man/TSHttpParserCreate.en', 'TSHttpParserCreate', u'Parse HTTP headers from memory buffers', None, u'3ts'),
 ]
 
 # If true, show URL addresses after external links.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a848aca7/doc/sdk/man/TSHttpParserCreate.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/man/TSHttpParserCreate.en.rst b/doc/sdk/man/TSHttpParserCreate.en.rst
new file mode 100644
index 0000000..0806564
--- /dev/null
+++ b/doc/sdk/man/TSHttpParserCreate.en.rst
@@ -0,0 +1,90 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+.. default-domain:: c
+
+===================
+`TSHttpParserCreate`
+===================
+
+Library
+=======
+Apache Traffic Server plugin API
+
+Synopsis
+========
+
+`#include <ts/ts.h>`
+
+.. function:: TSHttpParser TSHttpParserCreate(void)
+.. function:: void TSHttpParserClear(TSHttpParser parser)
+.. function:: void TSHttpParserDestroy(TSHttpParser parser)
+.. function:: TSParseResult TSHttpHdrParseReq(TSHttpParser parser, TSMBuffer bufp, TSMLoc offset, const char ** start, const char * end)
+.. function:: TSParseResult TSHttpHdrParseResp(TSHttpParser parser, TSMBuffer bufp, TSMLoc offset, const char ** start, const char * end)
+
+Description
+===========
+
+:func:`TSHttpParserCreate` creates an HTTP parser object. The
+parser's data structure contains information about the header being
+parsed. A single HTTP parser can be used multiple times, though not
+simultaneously. Before being used again, the parser must be cleared
+by calling :func:`TSHttpParserClear`.
+
+:func:`TSHttpHdrParseReq` parses an HTTP request header. The HTTP
+header :data:`offset` must already be created, and must reside
+inside the marshal buffer :data:`bufp`. The :data:`start` argument
+points to the current position of the string buffer being parsed
+and the :data:`end` argument points to one byte after the end of
+the buffer to be parsed. On return, :data:`start` is modified to
+point past the last character parsed.
+
+It is possible to parse an HTTP request header a single byte at a
+time using repeated calls to :func:`TSHttpHdrParseReq`. As long as
+an error does not occur, the :func:`TSHttpHdrParseReq` function
+will consume that single byte and ask for more. :func:`TSHttpHdrParseReq`
+should be called after :data:`TS_HTTP_READ_REQUEST_HDR_HOOK`.
+
+:func:`TSHttpHdrParseResp` operates in the same manner as
+:func:`TSHttpHdrParseReq` except it parses an HTTP response header.
+It should be called after :data:`TS_HTTP_READ_RESPONSE_HDR_HOOK`.
+
+:func:`TSHttpParserClear` clears the specified HTTP parser so it
+may be used again.
+
+:func:`TSHttpParserDestroy` destroys the TSHttpParser object pointed
+to by :data:`parser`. The :data:`parser` pointer must not be NULL.
+
+Return values
+=============
+
+:func:`TSHttpHdrParseReq` and :func:`TSHttpHdrParseResp` both return
+a :type:`TSParseResult` value. :data:`TS_PARSE_ERROR` is returned
+on error, :data:`TS_PARSE_CONT` is returned if parsing of the header
+stopped because the end of the buffer was reached, and
+:data:`TS_PARSE_DONE` or :data:`TS_PARSE_OK` when a \\r\\n\\r\\n
+pattern is encountered, indicating the end of the header.
+
+Bugs
+====
+
+The distinction between the :data:`TS_PARSE_DONE` and :data:`TS_PARSE_OK`
+results is not well-defined. Plugins should expect both status codes and
+treat them equivalently.
+
+See also
+========
+:manpage:`TSAPI(3ts)`

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a848aca7/doc/sdk/man/index.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/man/index.en.rst b/doc/sdk/man/index.en.rst
index 17b7210..9441dd5 100644
--- a/doc/sdk/man/index.en.rst
+++ b/doc/sdk/man/index.en.rst
@@ -24,4 +24,5 @@ API Reference
   TSAPI.en
   TSDebug.en
   TSHttpHookAdd.en
+  TSHttpParserCreate.en
 


[2/2] git commit: doc: add TSHttpTxnMilestoneGet to sphinx reference

Posted by jp...@apache.org.
doc: add TSHttpTxnMilestoneGet to sphinx reference


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/30d0925c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/30d0925c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/30d0925c

Branch: refs/heads/master
Commit: 30d0925c02ad4a1c6a541d7379fbfd7a19e4e216
Parents: a848aca
Author: James Peach <jp...@apache.org>
Authored: Fri Jul 12 22:29:17 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Jul 12 22:29:17 2013 -0700

----------------------------------------------------------------------
 doc/conf.py                              |  1 +
 doc/sdk/man/TSHttpTxnMilestoneGet.en.rst | 76 +++++++++++++++++++++++++++
 doc/sdk/man/index.en.rst                 |  2 +-
 3 files changed, 78 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/30d0925c/doc/conf.py
----------------------------------------------------------------------
diff --git a/doc/conf.py b/doc/conf.py
index 2c6540c..a4c366b 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -217,6 +217,7 @@ man_pages = [
     ('sdk/man/TSDebug.en', 'TSDebug', u'Traffic Server Debugging APIs', None, u'3ts'),
     ('sdk/man/TSHttpHookAdd.en', 'TSHttpHookAdd', u'Intercept Traffic Server events', None, u'3ts'),
     ('sdk/man/TSHttpParserCreate.en', 'TSHttpParserCreate', u'Parse HTTP headers from memory buffers', None, u'3ts'),
+    ('sdk/man/TSHttpTxnMilestoneGet.en', 'TSHttpTxnMilestoneGet', u'Get a specified milestone timer value for the current transaction', None, u'3ts'),
 ]
 
 # If true, show URL addresses after external links.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/30d0925c/doc/sdk/man/TSHttpTxnMilestoneGet.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/man/TSHttpTxnMilestoneGet.en.rst b/doc/sdk/man/TSHttpTxnMilestoneGet.en.rst
new file mode 100644
index 0000000..993d712
--- /dev/null
+++ b/doc/sdk/man/TSHttpTxnMilestoneGet.en.rst
@@ -0,0 +1,76 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+
+.. default-domain:: c
+
+=====================
+TSHttpTxnMilestoneGet
+=====================
+
+LIBRARY
+=======
+
+Apache Traffic Server plugin API
+
+SYNOPSIS
+========
+
+`#include <ts/ts.h>`
+
+.. function:: TSReturnCode TSHttpTxnMilestoneGet(TSHttpTxn txnp, TSMilestonesType milestone, TSHRTime * time)
+
+DESCRIPTION
+===========
+
+:func:`TSHttpTxnMilestoneGet` will fetch a specific milestone timer
+value for the current request. These timers are calculated during
+the lifetime of a transaction, and are all in :type:`TSHRTime` units
+(nanoseconds), measured from the beginning of the transaction. The
+:data:`time` argument is a pointer to a valid :type:`TSHRtime`
+storage, and is set upon success.
+
+The supported :type:`TSMilestonesType` milestone types are:
+
+|
+|
+| :data:`TS_MILESTONE_UA_BEGIN`
+| :data:`TS_MILESTONE_UA_READ_HEADER_DONE`
+| :data:`TS_MILESTONE_UA_BEGIN_WRITE`
+| :data:`TS_MILESTONE_UA_CLOSE`
+| :data:`TS_MILESTONE_SERVER_FIRST_CONNECT`
+| :data:`TS_MILESTONE_SERVER_CONNECT`
+| :data:`TS_MILESTONE_SERVER_CONNECT_END`
+| :data:`TS_MILESTONE_SERVER_BEGIN_WRITE`
+| :data:`TS_MILESTONE_SERVER_FIRST_READ`
+| :data:`TS_MILESTONE_SERVER_READ_HEADER_DONE`
+| :data:`TS_MILESTONE_SERVER_CLOSE`
+| :data:`TS_MILESTONE_CACHE_OPEN_READ_BEGIN`
+| :data:`TS_MILESTONE_CACHE_OPEN_READ_END`
+| :data:`TS_MILESTONE_CACHE_OPEN_WRITE_BEGIN`
+| :data:`TS_MILESTONE_CACHE_OPEN_WRITE_END`
+| :data:`TS_MILESTONE_DNS_LOOKUP_BEGIN`
+| :data:`TS_MILESTONE_DNS_LOOKUP_END`
+| :data:`TS_MILESTONE_SM_START`
+| :data:`TS_MILESTONE_SM_FINISH`
+| :data:`TS_MILESTONE_LAST_ENTRY`
+
+RETURN VALUES
+=============
+
+:data:`TS_SUCCESS` or :data:`TS_ERROR`.
+
+SEE ALSO
+========
+:manpage:`TSAPI(3ts)`

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/30d0925c/doc/sdk/man/index.en.rst
----------------------------------------------------------------------
diff --git a/doc/sdk/man/index.en.rst b/doc/sdk/man/index.en.rst
index 9441dd5..dcd34b3 100644
--- a/doc/sdk/man/index.en.rst
+++ b/doc/sdk/man/index.en.rst
@@ -25,4 +25,4 @@ API Reference
   TSDebug.en
   TSHttpHookAdd.en
   TSHttpParserCreate.en
-
+  TSHttpTxnMilestoneGet.en