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

[1/9] trafficserver git commit: TS-3803: CID 1313322 CID 1313322: HostDB memory issues (introduced in TS-3800)

Repository: trafficserver
Updated Branches:
  refs/heads/6.0.x 8aba18157 -> f0e395f59


TS-3803: CID 1313322 CID 1313322: HostDB memory issues (introduced in TS-3800)


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

Branch: refs/heads/6.0.x
Commit: 0cd1ef3ed5e4e6e3a332bccdd07220be717f2226
Parents: ec74792
Author: Brian Geffon <br...@apache.org>
Authored: Tue Jul 28 19:43:35 2015 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Tue Jul 28 19:43:35 2015 -0700

----------------------------------------------------------------------
 iocore/hostdb/HostDB.cc | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0cd1ef3e/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 5a9c85a..0d36fd6 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -1365,10 +1365,18 @@ HostDBContinuation::lookup_done(IpAddr const &ip, char const *aname, bool around
     }
   }
 
-  const size_t s_size = strlen(aname) + 1;
-  void *host_dest = hostDB.alloc(&i->hostname_offset, s_size);
-  ink_strlcpy((char *)host_dest, aname, s_size);
-  *((char *)host_dest + s_size) = '\0';
+  if (aname) {
+    const size_t s_size = strlen(aname) + 1;
+    void *host_dest = hostDB.alloc(&i->hostname_offset, s_size);
+    if (host_dest) {
+      ink_strlcpy((char *)host_dest, aname, s_size);
+      *((char *)host_dest + s_size) = '\0';
+    } else {
+      Warning("Out of room in hostdb for hostname (data area full!)");
+      hostDB.delete_block(i);
+      return NULL;
+    }
+  }
 
   if (from_cont)
     do_put_response(from, i, from_cont);


[6/9] trafficserver git commit: TS-3492 Only send SETTINGS which are different than protocol defaults

Posted by zw...@apache.org.
TS-3492 Only send SETTINGS which are different than protocol defaults


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

Branch: refs/heads/6.0.x
Commit: 213a70036ccbf39d5298674bdaa70d31f4fe1fca
Parents: 8a2b241
Author: Masaori Koshiba <mk...@yahoo-corp.jp>
Authored: Thu Jul 30 14:09:54 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 30 14:09:54 2015 -0600

----------------------------------------------------------------------
 proxy/http2/HTTP2.cc                |  9 +++++-
 proxy/http2/HTTP2.h                 |  2 +-
 proxy/http2/Http2ConnectionState.cc | 55 ++++++++++++++++++++++----------
 proxy/http2/Http2ConnectionState.h  |  4 +--
 4 files changed, 49 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/213a7003/proxy/http2/HTTP2.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index f089081..3b4ad96 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -255,7 +255,7 @@ http2_write_rst_stream(uint32_t error_code, IOVec iov)
 }
 
 bool
-http2_write_settings(const Http2SettingsParameter &param, IOVec iov)
+http2_write_settings(const Http2SettingsParameter &param, const IOVec &iov)
 {
   byte_pointer ptr(iov.iov_base);
 
@@ -772,6 +772,13 @@ Http2::init()
   REC_EstablishStaticConfigInt32U(max_header_list_size, "proxy.config.http2.max_header_list_size");
   REC_EstablishStaticConfigInt32U(max_request_header_size, "proxy.config.http.request_header_max_size");
 
+  // If any settings is broken, ATS should not start
+  ink_release_assert(http2_settings_parameter_is_valid({HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, max_concurrent_streams}) &&
+                     http2_settings_parameter_is_valid({HTTP2_SETTINGS_INITIAL_WINDOW_SIZE, initial_window_size}) &&
+                     http2_settings_parameter_is_valid({HTTP2_SETTINGS_MAX_FRAME_SIZE, max_frame_size}) &&
+                     http2_settings_parameter_is_valid({HTTP2_SETTINGS_HEADER_TABLE_SIZE, header_table_size}) &&
+                     http2_settings_parameter_is_valid({HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE, max_header_list_size}));
+
   // Setup statistics
   http2_rsb = RecAllocateRawStatBlock(static_cast<int>(HTTP2_N_STATS));
   RecRegisterRawStat(http2_rsb, RECT_PROCESS, HTTP2_STAT_CURRENT_CLIENT_SESSION_NAME, RECD_INT, RECP_NON_PERSISTENT,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/213a7003/proxy/http2/HTTP2.h
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.h b/proxy/http2/HTTP2.h
index a577a15..a398e0e 100644
--- a/proxy/http2/HTTP2.h
+++ b/proxy/http2/HTTP2.h
@@ -270,7 +270,7 @@ bool http2_write_headers(const uint8_t *, size_t, const IOVec &);
 
 bool http2_write_rst_stream(uint32_t, IOVec);
 
-bool http2_write_settings(const Http2SettingsParameter &, IOVec);
+bool http2_write_settings(const Http2SettingsParameter &, const IOVec &);
 
 bool http2_write_ping(const uint8_t *, IOVec);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/213a7003/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 32921fc..3bec688 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -614,23 +614,11 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
     // determination that HTTP/2 will be used by both peers, each endpoint MUST
     // send a connection preface as a final confirmation ... The server connection
     // preface consists of a potentially empty SETTINGS frame.
-    Http2Frame settings(HTTP2_FRAME_TYPE_SETTINGS, 0, 0);
-    settings.alloc(buffer_size_index[HTTP2_FRAME_TYPE_SETTINGS]);
-
-    // Send all settings values
-    IOVec iov = settings.write();
-    for (int i = 1; i < HTTP2_SETTINGS_MAX; i++) {
-      Http2SettingsIdentifier id = static_cast<Http2SettingsIdentifier>(i);
-      Http2SettingsParameter param;
-      param.id = id;
-      param.value = server_settings.get(id);
-      http2_write_settings(param, iov);
-      iov.iov_base = reinterpret_cast<uint8_t *>(iov.iov_base) + HTTP2_SETTINGS_PARAMETER_LEN;
-      iov.iov_len -= HTTP2_SETTINGS_PARAMETER_LEN;
-    }
 
-    settings.finalize(HTTP2_SETTINGS_PARAMETER_LEN * (HTTP2_SETTINGS_MAX - 1));
-    this->ua_session->handleEvent(HTTP2_SESSION_EVENT_XMIT, &settings);
+    // Load the server settings from the records.config / RecordsConfig.cc settings.
+    Http2ConnectionSettings configured_settings;
+    configured_settings.settings_from_configs();
+    send_settings_frame(configured_settings);
 
     if (server_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE) > HTTP2_INITIAL_WINDOW_SIZE) {
       send_window_update_frame(0, server_settings.get(HTTP2_SETTINGS_INITIAL_WINDOW_SIZE) - HTTP2_INITIAL_WINDOW_SIZE);
@@ -955,6 +943,41 @@ Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec)
 }
 
 void
+Http2ConnectionState::send_settings_frame(const Http2ConnectionSettings &new_settings)
+{
+  Http2Frame settings(HTTP2_FRAME_TYPE_SETTINGS, 0, 0);
+  settings.alloc(buffer_size_index[HTTP2_FRAME_TYPE_SETTINGS]);
+
+  IOVec iov = settings.write();
+  uint32_t settings_length = 0;
+
+  for (int i = HTTP2_SETTINGS_HEADER_TABLE_SIZE; i < HTTP2_SETTINGS_MAX; ++i) {
+    Http2SettingsIdentifier id = static_cast<Http2SettingsIdentifier>(i);
+    unsigned settings_value = new_settings.get(id);
+
+    // Send only difference
+    if (settings_value != server_settings.get(id)) {
+      const Http2SettingsParameter param = {static_cast<uint16_t>(id), settings_value};
+
+      // Write settings to send buffer
+      if (!http2_write_settings(param, iov)) {
+        send_goaway_frame(0, HTTP2_ERROR_INTERNAL_ERROR);
+        return;
+      }
+      iov.iov_base = reinterpret_cast<uint8_t *>(iov.iov_base) + HTTP2_SETTINGS_PARAMETER_LEN;
+      iov.iov_len -= HTTP2_SETTINGS_PARAMETER_LEN;
+      settings_length += HTTP2_SETTINGS_PARAMETER_LEN;
+
+      // Update current settings
+      server_settings.set(id, new_settings.get(id));
+    }
+  }
+
+  settings.finalize(settings_length);
+  this->ua_session->handleEvent(HTTP2_SESSION_EVENT_XMIT, &settings);
+}
+
+void
 Http2ConnectionState::send_ping_frame(Http2StreamId id, uint8_t flag, const uint8_t *opaque_data)
 {
   Http2Frame ping(HTTP2_FRAME_TYPE_PING, id, flag);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/213a7003/proxy/http2/Http2ConnectionState.h
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.h b/proxy/http2/Http2ConnectionState.h
index 42f05f4..6ba0753 100644
--- a/proxy/http2/Http2ConnectionState.h
+++ b/proxy/http2/Http2ConnectionState.h
@@ -223,9 +223,6 @@ public:
 
     continued_buffer.iov_base = NULL;
     continued_buffer.iov_len = 0;
-
-    // Load the server settings from the records.config / RecordsConfig.cc settings.
-    server_settings.settings_from_configs();
   }
 
   void
@@ -273,6 +270,7 @@ public:
   void send_data_frame(FetchSM *fetch_sm);
   void send_headers_frame(FetchSM *fetch_sm);
   void send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec);
+  void send_settings_frame(const Http2ConnectionSettings &new_settings);
   void send_ping_frame(Http2StreamId id, uint8_t flag, const uint8_t *opaque_data);
   void send_goaway_frame(Http2StreamId id, Http2ErrorCode ec);
   void send_window_update_frame(Http2StreamId id, uint32_t size);


[8/9] trafficserver git commit: TS-3807: Remove legacy log splitting code and docs.

Posted by zw...@apache.org.
TS-3807: Remove legacy log splitting code and docs.


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

Branch: refs/heads/6.0.x
Commit: 6d37b7c888eae4290c605729783ef1f8d4a384bb
Parents: 792a75b
Author: Phil Sorber <so...@apache.org>
Authored: Thu Jul 30 19:17:43 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Jul 30 19:17:43 2015 -0600

----------------------------------------------------------------------
 doc/admin/working-log-files.en.rst              |  13 --
 .../LC_MESSAGES/admin/working-log-files.en.po   |   8 -
 .../configuration/records.config.en.rst         |  15 --
 lib/perl/lib/Apache/TS/AdminClient.pm           |   2 -
 mgmt/RecordsConfig.cc                           |   4 -
 proxy/logging/LogConfig.cc                      | 164 +------------------
 proxy/logging/LogConfig.h                       |   6 +-
 tools/traffic_shell.pl                          |   7 -
 8 files changed, 9 insertions(+), 210 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/doc/admin/working-log-files.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/working-log-files.en.rst b/doc/admin/working-log-files.en.rst
index 85f1fd3..ab26d1d 100644
--- a/doc/admin/working-log-files.en.rst
+++ b/doc/admin/working-log-files.en.rst
@@ -637,19 +637,6 @@ Traffic Server also enables you to create XML-based
 :ref:`Custom Log Formats <using-custom-log-formats>` that offer even greater
 control over log file generation.
 
-Setting Log Splitting Options
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To set log splitting options, follow the steps below:
-
-#. In the :file:`records.config` file, edit the following variables
-
-   -  :ts:cv:`proxy.config.log.separate_icp_logs`
-   -  :ts:cv:`proxy.config.log.separate_host_logs`
-
-#. Run the command :option:`traffic_line -x` to apply the configuration
-   changes.
-
 Editing the log_hosts.config File
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
----------------------------------------------------------------------
diff --git a/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po b/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
index 91f3a3c..86754ef 100644
--- a/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
+++ b/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
@@ -1007,14 +1007,6 @@ msgstr ""
 msgid "To set log splitting options, follow the steps below:"
 msgstr ""
 
-#: ../../admin/working-log-files.en.rst:662
-msgid ":ts:cv:`proxy.config.log.separate_icp_logs`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:663
-msgid ":ts:cv:`proxy.config.log.separate_host_logs`"
-msgstr ""
-
 #: ../../admin/working-log-files.en.rst:669
 msgid "Editing the log_hosts.config File"
 msgstr ""

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index 0b0a150..257e070 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2068,21 +2068,6 @@ Logging Configuration
     The format can be either ``squid`` (Squid Format), ``common`` (Netscape Common),  ``extended`` (Netscape Extended),
     or  ``extended2`` (Netscape Extended-2).
 
-.. ts:cv:: CONFIG proxy.config.log.separate_icp_logs INT 0
-   :reloadable:
-
-   When enabled (``1``), configures Traffic Server to store ICP transactions in a separate log file.
-
-   -  ``0`` = separation is disabled, all ICP transactions are recorded in the same file as HTTP transactions
-   -  ``1`` = all ICP transactions are recorded in a separate log file.
-   -  ``-1`` = filter all ICP transactions from the default log files; ICP transactions are not logged anywhere.
-
-.. ts:cv:: CONFIG proxy.config.log.separate_host_logs INT 0
-   :reloadable:
-
-   When enabled (``1``), configures Traffic Server to create a separate log file for HTTP transactions for each origin server listed in the
-   :file:`log_hosts.config` file. Refer to :ref:`HTTP Host Log Splitting <httphostlogsplitting>`.
-
 .. ts:cv:: LOCAL proxy.local.log.collation_mode INT 0
    :reloadable:
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/lib/perl/lib/Apache/TS/AdminClient.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index 6940c15..9159e3e 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -599,8 +599,6 @@ The Apache Traffic Server Administration Manual will explain what these strings
  proxy.config.log.rolling_offset_hr
  proxy.config.log.rolling_size_mb
  proxy.config.log.sampling_frequency
- proxy.config.log.separate_host_logs
- proxy.config.log.separate_icp_logs
  proxy.config.log.space_used_frequency
  proxy.config.log.xml_config_file
  proxy.config.manager_binary

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 74ff03c..72e677f 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1134,10 +1134,6 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.log.hosts_config_file", RECD_STRING, "log_hosts.config", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.log.separate_icp_logs", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.separate_host_logs", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
   {RECT_CONFIG, "proxy.config.log.collation_host", RECD_STRING, NULL, RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.log.collation_port", RECD_INT, "8085", RECU_DYNAMIC, RR_REQUIRED, RECC_INT, "[0-65535]", RECA_NULL}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index bb31695..f9b1c0b 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -81,9 +81,6 @@ LogConfig::setup_default_values()
   logfile_perm = 0644;
   logfile_dir = ats_strdup(".");
 
-  separate_icp_logs = 1;
-  separate_host_logs = false;
-
   collation_mode = Log::NO_COLLATION;
   collation_host = ats_strdup("none");
   collation_port = 0;
@@ -202,32 +199,6 @@ LogConfig::read_configuration_variables()
     _exit(1);
   }
 
-  //
-  // for each predefined logging format, we need to know:
-  //   - whether logging in that format is enabled
-  //   - if we're logging to a file, what the name and format (ASCII,
-  //     BINARY) are
-  //   - what header should be written down at the start of each file for
-  //     this format
-  // this is accomplished with four config variables per format:
-  //   "proxy.config.log.<format>_log_enabled" INT
-  //   "proxy.config.log.<format>_log_is_ascii" INT
-  //   "proxy.config.log.<format>_log_name" STRING
-  //   "proxy.config.log.<format>_log_header" STRING
-  //
-
-  // SPLITTING
-  // 0 means no splitting
-  // 1 means splitting
-  // for icp
-  //   -1 means filter out (do not log and do not create split file)
-  val = (int)REC_ConfigReadInteger("proxy.config.log.separate_icp_logs");
-  separate_icp_logs = (val > 0);
-
-  val = (int)REC_ConfigReadInteger("proxy.config.log.separate_host_logs");
-  separate_host_logs = (val > 0);
-
-
   // COLLATION
   val = (int)REC_ConfigReadInteger("proxy.local.log.collation_mode");
   // do not restrict value so that error message is logged if
@@ -510,8 +481,6 @@ LogConfig::display(FILE *fd)
   fprintf(fd, "   hostname = %s\n", hostname);
   fprintf(fd, "   logfile_dir = %s\n", logfile_dir);
   fprintf(fd, "   logfile_perm = 0%o\n", logfile_perm);
-  fprintf(fd, "   separate_icp_logs = %d\n", separate_icp_logs);
-  fprintf(fd, "   separate_host_logs = %d\n", separate_host_logs);
   fprintf(fd, "   collation_mode = %d\n", collation_mode);
   fprintf(fd, "   collation_host = %s\n", collation_host);
   fprintf(fd, "   collation_port = %d\n", collation_port);
@@ -539,129 +508,13 @@ LogConfig::display(FILE *fd)
 }
 
 //-----------------------------------------------------------------------------
-// split_by_protocol
-//
-// This function creates the objects needed to log different protocols on
-// their own file if any of the "separate_xxx_logs" config. variable is set.
-//
-// Upon return, the pf_list argument holds the filters that reject the
-// protocols for which objects have been created. This filter list is used
-// to create the rest of the pre defined log objects.
-//
-// As input, this function requires a list wilh all information regarding
-// pre-defined formats.
-//
-LogFilter *
-LogConfig::split_by_protocol()
-{
-  if (!separate_icp_logs) {
-    return NULL;
-  }
-  // http MUST be last entry
-  enum {
-    icp = 0,
-    http,
-  };
-
-  int64_t value[] = {LOG_ENTRY_ICP, LOG_ENTRY_HTTP};
-  const char *filter_name[] = {"__icp__", "__http__"};
-  int64_t filter_val[http]; // protocols to reject
-  size_t n = 0;
-
-  LogField *etype_field = Log::global_field_list.find_by_symbol("etype");
-  ink_assert(etype_field);
-
-  if (separate_icp_logs) {
-    if (separate_icp_logs == 1) {
-      LogFilter *filter[1];
-
-      filter[0] = new LogFilterInt(filter_name[icp], etype_field, LogFilter::ACCEPT, LogFilter::MATCH, value[icp]);
-      delete filter[0];
-    }
-    filter_val[n++] = value[icp];
-  }
-
-  // At this point, separate objects for all protocols except http
-  // have been created if requested. We now add to the argument list
-  // the filters needed to reject the protocols that have already
-  // been taken care of. Note that we do not test for http since
-  // there is no "separate_http_logs" config variable and thus http
-  // could not have been taken care of at this point
-  //
-
-  if (n > 0) {
-    return new LogFilterInt("__reject_protocols__", etype_field, LogFilter::REJECT, LogFilter::MATCH, n, filter_val);
-  }
-  return NULL;
-}
-
-size_t
-LogConfig::split_by_hostname(LogFilter *reject_protocol_filter)
-{
-  size_t n_hosts;
-  char **host = read_log_hosts_file(&n_hosts); // allocates memory for array
-
-  if (n_hosts) {
-    size_t num_filt = 0;
-    LogFilter *rp_ah[2]; // rejected protocols + accepted host
-    LogField *shn_field = Log::global_field_list.find_by_symbol("shn");
-    ink_assert(shn_field);
-
-    if (reject_protocol_filter) {
-      rp_ah[num_filt++] = reject_protocol_filter;
-    }
-
-    for (size_t i = 0; i < n_hosts; ++i) {
-      // add a filter that accepts the specified hostname
-      //
-      char filter_name[LOG_MAX_FORMAT_LINE + 12];
-      snprintf(filter_name, LOG_MAX_FORMAT_LINE, "__accept_%s__", host[i]);
-      rp_ah[num_filt] =
-        new LogFilterString(filter_name, shn_field, LogFilter::ACCEPT, LogFilter::CASE_INSENSITIVE_CONTAIN, host[i]);
-
-      delete rp_ah[num_filt];
-    }
-
-    LogFilter *rp_rh[2]; // rejected protocols + rejected hosts
-
-    num_filt = 0;
-
-    if (reject_protocol_filter) {
-      rp_rh[num_filt++] = reject_protocol_filter;
-    }
-
-    rp_rh[num_filt] =
-      new LogFilterString("__reject_hosts__", shn_field, LogFilter::REJECT, LogFilter::CASE_INSENSITIVE_CONTAIN, n_hosts, host);
-
-    // create the "catch-all" object that contains logs for all
-    // hosts other than those specified in the hosts file and for
-    // those protocols that do not have their own file
-    //
-
-    delete rp_rh[num_filt];
-
-    delete[] host; // deallocate memory allocated by
-    // read_log_hosts_file
-  }
-  // host is not allocated unless n_hosts > 0
-  // coverity[leaked_storage]
-  return n_hosts;
-}
-
-//-----------------------------------------------------------------------------
 // setup_log_objects
 //
-// Construct:
-//
-// -All objects necessary to log the pre defined formats considering
-//  protocol and host splitting.
-// -All custom objects.
+// Construct: All custom objects.
 //
 // Upon return from this function:
 // - global_object_list has the aforementioned objects
 // - global_filter_list has all custom filters
-//   Note that the filters necessary to do log splitting for the pre defined
-//   format are kept private (e.g., they do not go to the global_filter_list).
 //
 void
 LogConfig::setup_log_objects()
@@ -719,14 +572,13 @@ LogConfig::register_config_callbacks()
   static const char *names[] = {
     "proxy.config.log.log_buffer_size", "proxy.config.log.max_secs_per_buffer", "proxy.config.log.max_space_mb_for_logs",
     "proxy.config.log.max_space_mb_for_orphan_logs", "proxy.config.log.max_space_mb_headroom", "proxy.config.log.logfile_perm",
-    "proxy.config.log.hostname", "proxy.config.log.logfile_dir", "proxy.config.log.separate_icp_logs",
-    "proxy.config.log.separate_host_logs", "proxy.local.log.collation_mode", "proxy.config.log.collation_host",
-    "proxy.config.log.collation_port", "proxy.config.log.collation_host_tagged", "proxy.config.log.collation_secret",
-    "proxy.config.log.collation_retry_sec", "proxy.config.log.collation_max_send_buffers", "proxy.config.log.rolling_enabled",
-    "proxy.config.log.rolling_interval_sec", "proxy.config.log.rolling_offset_hr", "proxy.config.log.rolling_size_mb",
-    "proxy.config.log.auto_delete_rolled_files", "proxy.config.log.custom_logs_enabled", "proxy.config.log.xml_config_file",
-    "proxy.config.log.hosts_config_file", "proxy.config.log.sampling_frequency", "proxy.config.log.file_stat_frequency",
-    "proxy.config.log.space_used_frequency",
+    "proxy.config.log.hostname", "proxy.config.log.logfile_dir", "proxy.local.log.collation_mode",
+    "proxy.config.log.collation_host", "proxy.config.log.collation_port", "proxy.config.log.collation_host_tagged",
+    "proxy.config.log.collation_secret", "proxy.config.log.collation_retry_sec", "proxy.config.log.collation_max_send_buffers",
+    "proxy.config.log.rolling_enabled", "proxy.config.log.rolling_interval_sec", "proxy.config.log.rolling_offset_hr",
+    "proxy.config.log.rolling_size_mb", "proxy.config.log.auto_delete_rolled_files", "proxy.config.log.custom_logs_enabled",
+    "proxy.config.log.xml_config_file", "proxy.config.log.hosts_config_file", "proxy.config.log.sampling_frequency",
+    "proxy.config.log.file_stat_frequency", "proxy.config.log.space_used_frequency",
   };
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/proxy/logging/LogConfig.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.h b/proxy/logging/LogConfig.h
index 424bffb..ba533f6 100644
--- a/proxy/logging/LogConfig.h
+++ b/proxy/logging/LogConfig.h
@@ -74,6 +74,7 @@ extern RecRawStatBlock *log_rsb;
 
 struct dirent;
 struct LogCollationAccept;
+
 /*-------------------------------------------------------------------------
   this object keeps the state of the logging configuraion variables.  upon
   construction, the log configuration file is read and the logging
@@ -176,8 +177,6 @@ public:
   int max_space_mb_for_orphan_logs;
   int max_space_mb_headroom;
   int logfile_perm;
-  bool separate_icp_logs;
-  bool separate_host_logs;
   int collation_mode;
   int collation_port;
   bool collation_host_tagged;
@@ -210,9 +209,6 @@ private:
   void setup_default_values();
   void setup_collation(LogConfig *prev_config);
 
-  LogFilter *split_by_protocol();
-  size_t split_by_hostname(LogFilter *reject_protocol);
-
 private:
   // if true, use max_space_mb_for_orphan_logs to determine the amount
   // of space that logging can use, otherwise use max_space_mb_for_logs

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/tools/traffic_shell.pl
----------------------------------------------------------------------
diff --git a/tools/traffic_shell.pl b/tools/traffic_shell.pl
index 4a13627..e65ea3f 100755
--- a/tools/traffic_shell.pl
+++ b/tools/traffic_shell.pl
@@ -523,9 +523,6 @@ sub show_logging {
   my $preproc_threads = get_on_off("proxy.config.log.collation_preproc_threads");
   my $orphan_space = get_int("proxy.config.log.max_space_mb_for_orphan_logs");
 
-  my $icp_log = get_on_off("proxy.config.log.separate_icp_logs");
-  my $http_host_log = get_on_off("proxy.config.log.separate_host_logs");
-
   my $custom_log = get_on_off("proxy.config.log.custom_logs_enabled");
 
   my $rolling = get_on_off("proxy.config.log.rolling_enabled");
@@ -548,10 +545,6 @@ Log Collation ---------------------------- $collation_mode
   Preproc Threads ------------------------ $preproc_threads
   Space Limit for Orphan Files ----------- $orphan_space MB
 
-Splitting
-  ICP Log Splitting ---------------------- $icp_log
-  HTTP Host Log Splitting ---------------- $http_host_log
-
 Custom Logs ------------------------------ $custom_log
 
 Rolling ---------------------------------- $rolling


[3/9] trafficserver git commit: Revert "TS-3752: Problem with larger headers and HTTP/2"

Posted by zw...@apache.org.
Revert "TS-3752: Problem with larger headers and HTTP/2"

This reverts commit 6c4c7226ea4d25c084d1d6b97ae6fec262b9f1f3.


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

Branch: refs/heads/6.0.x
Commit: f6cd56a713ad79d79754bfaaae2a3a08b8cd682d
Parents: fc13303
Author: Leif Hedstrom <zw...@apache.org>
Authored: Wed Jul 29 20:08:50 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Wed Jul 29 20:08:50 2015 -0600

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.cc | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f6cd56a7/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index eb24735..5235311 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -231,7 +231,7 @@ rcv_headers_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, const Ht
     // 4.3. A receiver MUST terminate the connection with a
     // connection error of type COMPRESSION_ERROR if it does
     // not decompress a header block.
-    if (decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
+    if (decoded_bytes == 0 || decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
       return HTTP2_ERROR_COMPRESSION_ERROR;
     }
 
@@ -560,7 +560,7 @@ rcv_continuation_frame(Http2ClientSession &cs, Http2ConnectionState &cstate, con
     // A receiver MUST terminate the connection with a
     // connection error of type COMPRESSION_ERROR if it does
     // not decompress a header block.
-    if (decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
+    if (decoded_bytes == 0 || decoded_bytes == HPACK_ERROR_COMPRESSION_ERROR) {
       return HTTP2_ERROR_COMPRESSION_ERROR;
     }
 
@@ -784,8 +784,6 @@ Http2ConnectionState::cleanup_streams()
 void
 Http2ConnectionState::set_continued_headers(const char *buf, uint32_t len, Http2StreamId id)
 {
-  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send CONTINUATION frame.", this->ua_session->connection_id());
-
   if (buf && len > 0) {
     if (!continued_buffer.iov_base) {
       continued_buffer.iov_base = static_cast<uint8_t *>(ats_malloc(len));
@@ -831,11 +829,11 @@ Http2ConnectionState::update_initial_rwnd(Http2WindowSize new_size)
 void
 Http2ConnectionState::send_data_frame(FetchSM *fetch_sm)
 {
-  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send DATA frame", this->ua_session->connection_id());
-
   size_t buf_len = BUFFER_SIZE_FOR_INDEX(buffer_size_index[HTTP2_FRAME_TYPE_DATA]) - HTTP2_FRAME_HEADER_LEN;
   uint8_t payload_buffer[buf_len];
 
+  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send DATA frame.", this->ua_session->connection_id());
+
   Http2Stream *stream = static_cast<Http2Stream *>(fetch_sm->ext_get_user_data());
 
   for (;;) {
@@ -894,8 +892,6 @@ Http2ConnectionState::send_data_frame(FetchSM *fetch_sm)
 void
 Http2ConnectionState::send_headers_frame(FetchSM *fetch_sm)
 {
-  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send HEADERS frame.", this->ua_session->connection_id());
-
   const size_t buf_len = BUFFER_SIZE_FOR_INDEX(buffer_size_index[HTTP2_FRAME_TYPE_HEADERS]) - HTTP2_FRAME_HEADER_LEN;
   uint8_t payload_buffer[buf_len];
   size_t payload_length = 0;
@@ -945,8 +941,6 @@ Http2ConnectionState::send_headers_frame(FetchSM *fetch_sm)
 void
 Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec)
 {
-  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send RST_STREAM frame.", this->ua_session->connection_id());
-
   Http2Frame rst_stream(HTTP2_FRAME_TYPE_RST_STREAM, id, 0);
 
   rst_stream.alloc(buffer_size_index[HTTP2_FRAME_TYPE_RST_STREAM]);
@@ -961,8 +955,6 @@ Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec)
 void
 Http2ConnectionState::send_ping_frame(Http2StreamId id, uint8_t flag, const uint8_t *opaque_data)
 {
-  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send PING frame.", this->ua_session->connection_id());
-
   Http2Frame ping(HTTP2_FRAME_TYPE_PING, id, flag);
 
   ping.alloc(buffer_size_index[HTTP2_FRAME_TYPE_PING]);
@@ -977,8 +969,6 @@ Http2ConnectionState::send_ping_frame(Http2StreamId id, uint8_t flag, const uint
 void
 Http2ConnectionState::send_goaway_frame(Http2StreamId id, Http2ErrorCode ec)
 {
-  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send GOAWAY frame.", this->ua_session->connection_id());
-
   Http2Frame frame(HTTP2_FRAME_TYPE_GOAWAY, 0, 0);
   Http2Goaway goaway;
 
@@ -1001,8 +991,6 @@ Http2ConnectionState::send_goaway_frame(Http2StreamId id, Http2ErrorCode ec)
 void
 Http2ConnectionState::send_window_update_frame(Http2StreamId id, uint32_t size)
 {
-  DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send WINDOW_UPDATE frame.", this->ua_session->connection_id());
-
   // Create WINDOW_UPDATE frame
   Http2Frame window_update(HTTP2_FRAME_TYPE_WINDOW_UPDATE, id, 0x0);
   window_update.alloc(buffer_size_index[HTTP2_FRAME_TYPE_WINDOW_UPDATE]);


[5/9] trafficserver git commit: TS-3766 Ignore unknown frame in debugging

Posted by zw...@apache.org.
TS-3766 Ignore unknown frame in debugging


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

Branch: refs/heads/6.0.x
Commit: 8a2b2413399d4fb11a69431146db8d7ebee7219f
Parents: 0749fd8
Author: Masaori Koshiba <mk...@yahoo-corp.jp>
Authored: Thu Jul 30 13:47:02 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 30 13:47:02 2015 -0600

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8a2b2413/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 5235311..32921fc 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -653,9 +653,11 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
     Http2StreamId last_streamid = frame->header().streamid;
     Http2ErrorCode error;
 
-    //  Implementations MUST ignore and discard any frame that has a type that is unknown.
-    ink_assert(frame->header().type < HTTP2_FRAME_TYPE_MAX);
+    // 5.5 Extending HTTP/2
+    //   Implementations MUST discard frames that have unknown or unsupported types.
     if (frame->header().type >= HTTP2_FRAME_TYPE_MAX) {
+      DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Discard a frame which has unknown type, type=%x",
+               this->ua_session->connection_id(), frame->header().type);
       return 0;
     }
 


[4/9] trafficserver git commit: [TS-3476] Add a log tag for application protocol (add docs)

Posted by zw...@apache.org.
[TS-3476] Add a log tag for application protocol (add docs)

This closes #250


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

Branch: refs/heads/6.0.x
Commit: 0749fd89cf64f24542c851e14e58db178442e18d
Parents: f6cd56a
Author: ericcarlschwartz <es...@gmail.com>
Authored: Mon Jul 13 17:13:22 2015 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 30 09:10:54 2015 -0600

----------------------------------------------------------------------
 doc/admin/event-logging-formats.en.rst | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0749fd89/doc/admin/event-logging-formats.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/event-logging-formats.en.rst b/doc/admin/event-logging-formats.en.rst
index b390965..1bb1382 100644
--- a/doc/admin/event-logging-formats.en.rst
+++ b/doc/admin/event-logging-formats.en.rst
@@ -147,6 +147,11 @@ The following list describes Traffic Server custom logging fields.
 ``cqhv``
     The client request HTTP version.
 
+.. _cqpv:
+
+``cqhv``
+    The client request protocol & version.
+
 .. _cqtd:
 
 ``cqtd``


[9/9] trafficserver git commit: Merge branch 'master' into 6.0.x

Posted by zw...@apache.org.
Merge branch 'master' into 6.0.x

* master:
  TS-3807: Remove legacy log splitting code and docs.
  TS-3749: Re-enable error log.
  TS-3492 Only send SETTINGS which are different than protocol defaults
  TS-3766 Ignore unknown frame in debugging
  [TS-3476] Add a log tag for application protocol (add docs)
  Revert "TS-3752: Problem with larger headers and HTTP/2"
  TS-3800: Fix bug in hostdb ui related to missing query
  TS-3803: CID 1313322 CID 1313322: HostDB memory issues (introduced in TS-3800)


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

Branch: refs/heads/6.0.x
Commit: f0e395f598ee6f4bc5c69db5ac9186a9c2f77787
Parents: 8aba181 6d37b7c
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jul 30 20:13:46 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jul 30 20:13:46 2015 -0600

----------------------------------------------------------------------
 doc/admin/event-logging-formats.en.rst          |   5 +
 doc/admin/working-log-files.en.rst              |  13 --
 .../LC_MESSAGES/admin/working-log-files.en.po   |   8 -
 .../configuration/records.config.en.rst         |  15 --
 iocore/hostdb/HostDB.cc                         |  18 +-
 lib/perl/lib/Apache/TS/AdminClient.pm           |   2 -
 mgmt/RecordsConfig.cc                           |   4 -
 proxy/http2/HTTP2.cc                            |   9 +-
 proxy/http2/HTTP2.h                             |   2 +-
 proxy/http2/Http2ConnectionState.cc             |  61 +++++--
 proxy/http2/Http2ConnectionState.h              |   4 +-
 proxy/logging/LogConfig.cc                      | 180 +++----------------
 proxy/logging/LogConfig.h                       |   6 +-
 tools/traffic_shell.pl                          |   7 -
 14 files changed, 95 insertions(+), 239 deletions(-)
----------------------------------------------------------------------



[2/9] trafficserver git commit: TS-3800: Fix bug in hostdb ui related to missing query

Posted by zw...@apache.org.
TS-3800: Fix bug in hostdb ui related to missing query


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

Branch: refs/heads/6.0.x
Commit: fc133036c2e4a6cd8d95c9432cd62e703a3303b1
Parents: 0cd1ef3
Author: Brian Geffon <br...@apache.org>
Authored: Tue Jul 28 20:20:57 2015 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Tue Jul 28 20:20:57 2015 -0700

----------------------------------------------------------------------
 iocore/hostdb/HostDB.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fc133036/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 0d36fd6..984d137 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -2672,7 +2672,7 @@ register_ShowHostDB(Continuation *c, HTTPHdr *h)
   } else if (STR_LEN_EQ_PREFIX(path, path_len, "showall")) {
     int query_len = 0;
     const char *query = h->url_get()->query_get(&query_len);
-    if (strstr(query, "json")) {
+    if (query && query_len && strstr(query, "json")) {
       s->output_json = true;
     }
     Debug("hostdb", "dumping all hostdb records");


[7/9] trafficserver git commit: TS-3749: Re-enable error log.

Posted by zw...@apache.org.
TS-3749: Re-enable error log.


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

Branch: refs/heads/6.0.x
Commit: 792a75b1aa348b0d51256635a54f6ff534a8dcf8
Parents: 213a700
Author: Phil Sorber <so...@apache.org>
Authored: Thu Jul 30 18:54:14 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Jul 30 18:54:14 2015 -0600

----------------------------------------------------------------------
 proxy/logging/LogConfig.cc | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/792a75b1/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index aa5d160..bb31695 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -446,7 +446,21 @@ LogConfig::init(LogConfig *prev_config)
   }
 
   // ----------------------------------------------------------------------
-  Log::error_log = NULL;
+  // Construct a new error log object candidate.
+  if (Log::error_logging_enabled()) {
+    LogFormat *fmt;
+
+    Debug("log", "creating predefined error log object");
+
+    fmt = MakeTextLogFormat("error");
+    this->global_format_list.add(fmt, false);
+    errlog = new LogObject(fmt, logfile_dir, "error.log", LOG_FILE_ASCII, NULL, (Log::RollingEnabledValues)rolling_enabled,
+                           collation_preproc_threads, rolling_interval_sec, rolling_offset_hr, rolling_size_mb);
+    log_object_manager.manage_object(errlog);
+    errlog->set_fmt_timestamps();
+  } else {
+    Log::error_log = NULL;
+  }
 
   if (prev_config) {
     // Transfer objects from previous configuration.