trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject git commit: TS-977: Fix RecMessageSend regression
Date Tue, 15 Jan 2013 08:45:39 GMT
Updated Branches:
  refs/heads/master 754777367 -> 461de9227


TS-977: Fix RecMessageSend regression

After removing the static g_mode_type variable from RecMessage.cc file
by previous commit: 3321de50, traffic_manager will crash when boot.

The root cause is that RecMessageSend() will be called before lmgmt has
been initialized.

We can simply check g_message_initialized instead of g_mode_type to
decide whether RecMessageSend() could be executed safely.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
Signed-off-by: Zhao Yongming <ming.zym@gmail.com>


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

Branch: refs/heads/master
Commit: 461de9227d49786fbcdbae4ccbde09341deb71f2
Parents: 7547773
Author: Yunkai Zhang <qiushu.zyk@taobao.com>
Authored: Tue Jan 15 16:50:31 2013 +0800
Committer: Zhao Yongming <ming.zym@gmail.com>
Committed: Tue Jan 15 16:36:01 2013 +0800

----------------------------------------------------------------------
 lib/records/RecMessage.cc |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/461de922/lib/records/RecMessage.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecMessage.cc b/lib/records/RecMessage.cc
index a9135ac..17b36e2 100644
--- a/lib/records/RecMessage.cc
+++ b/lib/records/RecMessage.cc
@@ -249,6 +249,9 @@ RecMessageSend(RecMessage * msg)
 {
   int msg_size;
 
+  if (!g_message_initialized)
+    return REC_ERR_OKAY;
+
   // Make a copy of the record, but truncate it to the size actually used
   if (g_mode_type == RECM_CLIENT || g_mode_type == RECM_SERVER) {
     msg->o_end = msg->o_write;


Mime
View raw message