JosiahWI commented on code in PR #14084:
URL: https://github.com/apache/trafficserver/pull/14084#discussion_r4600046919
##########
src/iocore/net/UnixNetProcessor.cc:
##########
@@ -295,9 +295,6 @@ UnixNetProcessor::init_socks()
Warning("We can not have accept_enabled and socks_needed turned off"
" disabling Socks accept\n");
socks_conf_stuff->accept_enabled = 0;
- } else {
- // this is sslNetprocessor
- socks_conf_stuff = netProcessor.socks_conf_stuff;
Review Comment:
What was someone trying to do here? This is very confusing, but the comment
suggests someone was trying to address a very subtle issue related to
inheritance, and we might be reintroducing a bug.
##########
src/tscore/unit_tests/test_ink_file.cc:
##########
@@ -0,0 +1,71 @@
+/** @file
+
+ test ink_file.h - file helpers
+
+ @section license License
+
+ 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.
+*/
+
+#include "tscore/ink_file.h"
+#include <catch2/catch_test_macros.hpp>
+
+#include <cstring>
+#include <fcntl.h>
+#include <unistd.h>
+
+TEST_CASE("ink_file_fd_writestring returns the number of bytes written",
"[ink_file]")
Review Comment:
This test description is incorrect. The test additionally checks that the
written string matches the expected value. These should be split into two
separate tests.
##########
plugins/lua/ts_lua_transform.cc:
##########
@@ -189,12 +189,6 @@ ts_lua_client_handler(TSCont contp,
ts_lua_http_transform_ctx *transform_ctx, TS
} else {
lua_pushinteger(L, 0); /* second param, data not finish */
}
- } else {
- lua_pushlightuserdata(L, transform_ctx);
- lua_rawget(L, LUA_GLOBALSINDEX); /* push function */
-
- lua_pushlstring(L, "", 0);
- lua_pushinteger(L, 1); /* second param, data finished */
}
Review Comment:
If this is indeed unreachable, then the conditional check on line 170 is
guaranteed to take the true branch, and we don't need line 170, either. Hoist
the true branch body, and add an assertion at the point `empty_input` is
calculated that it is indeed equal to `0`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]