Merge pull request #10255 from akallabeth/cov_warn_fix

[proxy,modules] replace global constructor
This commit is contained in:
akallabeth 2024-06-05 16:20:19 +02:00 committed by GitHub
commit 223fca31da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 32 additions and 13 deletions

View File

@ -20,5 +20,5 @@ jobs:
# lgtm_comment_body, max_comments, and annotations need to be set on the posting workflow in a split setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
annotations: true
annotations: false
max_comments: 10

View File

@ -100,7 +100,7 @@ static BOOL treatReadResult(WINPR_BIO_NAMED* ptr, DWORD readBytes)
static BOOL doReadOp(WINPR_BIO_NAMED* ptr)
{
DWORD readBytes;
DWORD readBytes = 0;
if (!ResetEvent(ptr->readEvent))
return FALSE;
@ -162,7 +162,7 @@ static int transport_bio_named_read(BIO* bio, char* buf, int size)
return -1;
}
DWORD readBytes;
DWORD readBytes = 0;
if (!GetOverlappedResult(ptr->hFile, &ptr->readOverlapped, &readBytes, FALSE))
{
WLog_ERR(TAG, "GetOverlappedResult blocking(lastError=%" PRIu32 ")",
@ -195,7 +195,7 @@ static int transport_bio_named_read(BIO* bio, char* buf, int size)
return -1;
}
DWORD readBytes;
DWORD readBytes = 0;
if (!GetOverlappedResult(ptr->hFile, &ptr->readOverlapped, &readBytes, FALSE))
{
WLog_ERR(TAG, "GetOverlappedResult non blocking(lastError=%" PRIu32 ")",

View File

@ -42,8 +42,21 @@ static constexpr char plugin_name[] = "bitmap-filter";
static constexpr char plugin_desc[] =
"this plugin deactivates and filters persistent bitmap cache.";
static const std::vector<std::string> plugin_static_intercept = { DRDYNVC_SVC_CHANNEL_NAME };
static const std::vector<std::string> plugin_dyn_intercept = { RDPGFX_DVC_CHANNEL_NAME };
static const std::vector<std::string>& plugin_static_intercept()
{
static std::vector<std::string> vec;
if (vec.empty())
vec.push_back(DRDYNVC_SVC_CHANNEL_NAME);
return vec;
}
static const std::vector<std::string>& plugin_dyn_intercept()
{
static std::vector<std::string> vec;
if (vec.empty())
vec.push_back(RDPGFX_DVC_CHANNEL_NAME);
return vec;
}
class DynChannelState
{
@ -126,8 +139,8 @@ static BOOL filter_dyn_channel_intercept_list(proxyPlugin* plugin, proxyData* pd
WINPR_ASSERT(pdata);
WINPR_ASSERT(data);
auto intercept = std::find(plugin_dyn_intercept.begin(), plugin_dyn_intercept.end(),
data->name) != plugin_dyn_intercept.end();
auto intercept = std::find(plugin_dyn_intercept().begin(), plugin_dyn_intercept().end(),
data->name) != plugin_dyn_intercept().end();
if (intercept)
data->intercept = TRUE;
return TRUE;
@ -141,8 +154,8 @@ static BOOL filter_static_channel_intercept_list(proxyPlugin* plugin, proxyData*
WINPR_ASSERT(pdata);
WINPR_ASSERT(data);
auto intercept = std::find(plugin_static_intercept.begin(), plugin_static_intercept.end(),
data->name) != plugin_static_intercept.end();
auto intercept = std::find(plugin_static_intercept().begin(), plugin_static_intercept().end(),
data->name) != plugin_static_intercept().end();
if (intercept)
data->intercept = TRUE;
return TRUE;

View File

@ -55,7 +55,13 @@ static constexpr char plugin_name[] = "dyn-channel-dump";
static constexpr char plugin_desc[] =
"This plugin dumps configurable dynamic channel data to a file.";
static const std::vector<std::string> plugin_static_intercept = { DRDYNVC_SVC_CHANNEL_NAME };
static const std::vector<std::string>& plugin_static_intercept()
{
static std::vector<std::string> vec;
if (vec.empty())
vec.push_back(DRDYNVC_SVC_CHANNEL_NAME);
return vec;
}
static constexpr char key_path[] = "path";
static constexpr char key_channels[] = "channels";
@ -286,8 +292,8 @@ static BOOL dump_static_channel_intercept_list(proxyPlugin* plugin, proxyData* p
WINPR_ASSERT(pdata);
WINPR_ASSERT(data);
auto intercept = std::find(plugin_static_intercept.begin(), plugin_static_intercept.end(),
data->name) != plugin_static_intercept.end();
auto intercept = std::find(plugin_static_intercept().begin(), plugin_static_intercept().end(),
data->name) != plugin_static_intercept().end();
if (intercept)
{
WLog_INFO(TAG, "intercepting channel '%s'", data->name);