From fe60404f0f44f8ac6e62ba1fe69a21a0ae59b7db Mon Sep 17 00:00:00 2001 From: Daniel Thayer Date: Wed, 16 Oct 2013 13:13:53 -0500 Subject: [PATCH] Fix typos and formatting in the http protocol docs Also adjusted line numbers in scripting doc due to changes in http/main.bro --- doc/scripting/index.rst | 2 +- scripts/base/protocols/http/entities.bro | 6 ++++-- scripts/base/protocols/http/main.bro | 10 ++++++---- scripts/base/protocols/http/utils.bro | 16 ++++++++-------- ...de-scripts_base_protocols_http_main_bro.btest | 3 ++- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/doc/scripting/index.rst b/doc/scripting/index.rst index 12085c5382..a24032f524 100644 --- a/doc/scripting/index.rst +++ b/doc/scripting/index.rst @@ -351,7 +351,7 @@ decrypted from HTTP streams is stored in excerpt from :doc:`/scripts/base/protocols/http/main` below. .. btest-include:: ${BRO_SRC_ROOT}/scripts/base/protocols/http/main.bro - :lines: 8-10,19,20,118 + :lines: 8-10,19-21,120 Because the constant was declared with the ``&redef`` attribute, if we needed to turn this option on globally, we could do so by adding the diff --git a/scripts/base/protocols/http/entities.bro b/scripts/base/protocols/http/entities.bro index e9376a0c0c..0239e0fa85 100644 --- a/scripts/base/protocols/http/entities.bro +++ b/scripts/base/protocols/http/entities.bro @@ -28,9 +28,11 @@ export { ## The current entity. current_entity: Entity &optional; - ## Current number of MIME entities in the HTTP request message body. + ## Current number of MIME entities in the HTTP request message + ## body. orig_mime_depth: count &default=0; - ## Current number of MIME entities in the HTTP response message body. + ## Current number of MIME entities in the HTTP response message + ## body. resp_mime_depth: count &default=0; }; } diff --git a/scripts/base/protocols/http/main.bro b/scripts/base/protocols/http/main.bro index e103bc6b41..a164fcd6a6 100644 --- a/scripts/base/protocols/http/main.bro +++ b/scripts/base/protocols/http/main.bro @@ -16,7 +16,8 @@ export { EMPTY }; - ## This setting changes if passwords used in Basic-Auth are captured or not. + ## This setting changes if passwords used in Basic-Auth are captured or + ## not. const default_capture_password = F &redef; type Info: record { @@ -36,8 +37,8 @@ export { ## URI used in the request. uri: string &log &optional; ## Value of the "referer" header. The comment is deliberately - ## misspelled like the standard declares, but the name used here is - ## "referrer" spelled correctly. + ## misspelled like the standard declares, but the name used here + ## is "referrer" spelled correctly. referrer: string &log &optional; ## Value of the User-Agent header from the client. user_agent: string &log &optional; @@ -55,7 +56,8 @@ export { info_code: count &log &optional; ## Last seen 1xx informational reply message returned by the server. info_msg: string &log &optional; - ## Filename given in the Content-Disposition header sent by the server. + ## Filename given in the Content-Disposition header sent by the + ## server. filename: string &log &optional; ## A set of indicators of various attributes discovered and ## related to a particular request/response pair. diff --git a/scripts/base/protocols/http/utils.bro b/scripts/base/protocols/http/utils.bro index fe8c076780..3c75ae254b 100644 --- a/scripts/base/protocols/http/utils.bro +++ b/scripts/base/protocols/http/utils.bro @@ -6,8 +6,8 @@ module HTTP; export { - ## Given a string containing a series of key-value pairs separated by "=", - ## this function can be used to parse out all of the key names. + ## Given a string containing a series of key-value pairs separated + ## by "=", this function can be used to parse out all of the key names. ## ## data: The raw data, such as a URL or cookie value. ## @@ -17,20 +17,20 @@ export { ## Returns: A vector of strings containing the keys. global extract_keys: function(data: string, kv_splitter: pattern): string_vec; - ## Creates a URL from an :bro:type:`HTTP::Info` record. This should handle - ## edge cases such as proxied requests appropriately. + ## Creates a URL from an :bro:type:`HTTP::Info` record. This should + ## handle edge cases such as proxied requests appropriately. ## ## rec: An :bro:type:`HTTP::Info` record. ## - ## Returns: A URL, not prefixed by "http://". + ## Returns: A URL, not prefixed by ``"http://"``. global build_url: function(rec: Info): string; - ## Creates a URL from an :bro:type:`HTTP::Info` record. This should handle - ## edge cases such as proxied requests appropriately. + ## Creates a URL from an :bro:type:`HTTP::Info` record. This should + ## handle edge cases such as proxied requests appropriately. ## ## rec: An :bro:type:`HTTP::Info` record. ## - ## Returns: A URL prefixed with "http://". + ## Returns: A URL prefixed with ``"http://"``. global build_url_http: function(rec: Info): string; ## Create an extremely shortened representation of a log line. diff --git a/testing/btest/doc/sphinx/include-scripts_base_protocols_http_main_bro.btest b/testing/btest/doc/sphinx/include-scripts_base_protocols_http_main_bro.btest index c2e558bac8..e3f7a39429 100644 --- a/testing/btest/doc/sphinx/include-scripts_base_protocols_http_main_bro.btest +++ b/testing/btest/doc/sphinx/include-scripts_base_protocols_http_main_bro.btest @@ -5,6 +5,7 @@ main.bro module HTTP; export { - ## This setting changes if passwords used in Basic-Auth are captured or not. + ## This setting changes if passwords used in Basic-Auth are captured or + ## not. const default_capture_password = F &redef; }