Skip to content

Commit

Permalink
Update liblcb: Remove syntax shugar.
Browse files Browse the repository at this point in the history
  • Loading branch information
rozhuk-im committed Apr 28, 2024
1 parent 0143aaa commit e414757
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions msd_lite.project
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeLite_Project Name="msd_lite" InternalType="" Version="11000">
<VirtualDirectory Name="workflows">
<File Name=".github/workflows/build-ubuntu-latest.yml"/>
<File Name=".github/workflows/build-macos-latest.yml"/>
</VirtualDirectory>
<Plugins>
<Plugin Name="CppCheck"/>
<Plugin Name="CMakePlugin">
Expand All @@ -28,6 +24,10 @@
}]]]>
</Plugin>
</Plugins>
<VirtualDirectory Name="workflows">
<File Name=".github/workflows/build-ubuntu-latest.yml"/>
<File Name=".github/workflows/build-macos-latest.yml"/>
</VirtualDirectory>
<VirtualDirectory Name="conf">
<File Name="conf/msd_lite.conf"/>
</VirtualDirectory>
Expand Down Expand Up @@ -114,7 +114,7 @@
<Dependencies Name="Release"/>
<Settings Type="Executable">
<GlobalSettings>
<Compiler Options="" C_Options="-fsanitize=safe-stack;-D_FORTIFY_SOURCE=2;-fstack-protector;-fPIE;-fomit-frame-pointer;-DTHREAD_POOL_SETTINGS_XML;-DHTTP_SRV_XML_CONFIG;-DSOCKET_XML_CONFIG;-DMPEG2TS_XML_CONFIG;-DHAVE_PIPE2;-DHAVE_ACCEPT4;-DHAVE_MEMRCHR;-DHAVE_MEMMEM;-DHAVE_REALLOCARRAY;-DHAVE_MEMSET_S;-DHAVE_EXPLICIT_BZERO;-DHAVE_STRLCPY" Assembler="">
<Compiler Options="" C_Options="-fsanitize=safe-stack;-D_FORTIFY_SOURCE=2;-fstack-protector;-fPIE;-fomit-frame-pointer;-DTHREAD_POOL_SETTINGS_XML;-DHTTP_SRV_XML_CONFIG;-DSOCKET_XML_CONFIG;-DMPEG2TS_XML_CONFIG;-DHAVE_PIPE2;-DHAVE_ACCEPT4;-DHAVE_MEMRCHR;-DHAVE_MEMMEM;-DHAVE_REALLOCARRAY;-DHAVE_MEMSET_S;-DHAVE_EXPLICIT_BZERO;-DHAVE_STRLCPY;-DHAVE_KQUEUEX;-DHAVE_TIMINGSAFE_BCMP" Assembler="">
<IncludePath Value="$(IntermediateDirectory)"/>
<IncludePath Value="../"/>
<IncludePath Value="../src"/>
Expand Down
2 changes: 1 addition & 1 deletion src/liblcb
Submodule liblcb updated 47 files
+1 −0 CMakeLists.txt
+1 −1 include/al/hw.h
+29 −15 include/al/os.h
+1 −1 include/crypto/hash/gost3411-2012.h
+1 −1 include/crypto/hash/md5.h
+1 −1 include/crypto/hash/sha1.h
+1 −1 include/crypto/hash/sha2.h
+1 −1 include/math/big_num.h
+5 −5 include/net/host_address.h
+5 −3 include/net/hostname_list.h
+1 −1 include/proto/dns.h
+5 −19 include/proto/radius.h
+12 −4 include/threadpool/threadpool.h
+1 −1 include/utils/hash_bucket.h
+4 −46 include/utils/mem_utils.h
+1 −3 lib.project
+8 −0 liblcb.workspace
+8 −9 src/net/socket.c
+4 −4 src/net/socket_address.c
+4 −6 src/net/socket_options.c
+1 −1 src/net/utils.c
+4 −4 src/proto/bt_tracker.c
+8 −7 src/proto/dns_resolv.c
+2 −2 src/proto/http.c
+7 −7 src/proto/http_client.c
+10 −9 src/proto/http_server.c
+2 −2 src/proto/http_server_auth.c
+13 −14 src/proto/radius_client.c
+3 −3 src/proto/sap_rcvr.c
+8 −8 src/proto/upnp_ssdp.c
+123 −67 src/threadpool/threadpool.c
+4 −4 src/threadpool/threadpool_msg_sys.c
+4 −4 src/threadpool/threadpool_task.c
+2 −2 src/utils/bt_encode.c
+4 −4 src/utils/buf_str.c
+1 −1 src/utils/cmd_line_daemon.c
+4 −5 src/utils/data_cache.c
+2 −1 src/utils/info.c
+3 −3 src/utils/ini.c
+2 −2 src/utils/ring_buffer.c
+3 −3 src/utils/sys.c
+1 −1 src/utils/sys_res_limits_xml.c
+2 −2 src/utils/xml.c
+1 −1 tests/base64/main.c
+1 −1 tests/ecdsa/main.c
+17 −5 tests/threadpool/main.c
+38 −1 tests/threadpool/test-threadpool.project
2 changes: 1 addition & 1 deletion src/msd_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ main(int argc, char *argv[]) {
cmd_line_data_t cmd_line_data;


mem_bzero(&g_data, sizeof(g_data));
memset(&g_data, 0x00, sizeof(g_data));
if (0 != cmd_line_parse(argc, argv, &cmd_line_data)) {
cmd_line_usage(PACKAGE_DESCRIPTION, PACKAGE_VERSION,
"Rozhuk Ivan <[email protected]>",
Expand Down
24 changes: 12 additions & 12 deletions src/stream_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ str_hub_settings_def(str_hub_settings_p p_ret) {

if (NULL == p_ret)
return;
mem_bzero(p_ret, sizeof(str_hub_settings_t));
memset(p_ret, 0x00, sizeof(str_hub_settings_t));
p_ret->flags = STR_HUB_S_DEF_FLAGS;
p_ret->ring_buf_size = STR_HUB_S_DEF_RING_BUF_SIZE;
p_ret->precache = STR_HUB_S_DEF_PRECAHE;
Expand All @@ -155,7 +155,7 @@ str_src_settings_def(str_src_settings_p p_ret) {

if (NULL == p_ret)
return;
mem_bzero(p_ret, sizeof(str_src_settings_t));
memset(p_ret, 0x00, sizeof(str_src_settings_t));
p_ret->skt_rcv_buf = STR_SRC_S_DEF_SKT_RCV_BUF;
p_ret->skt_rcv_lowat = STR_SRC_S_DEF_SKT_RCV_LOWAT;
p_ret->rcv_timeout = STR_SRC_S_DEF_UDP_RCV_TIMEOUT;
Expand All @@ -166,7 +166,7 @@ str_src_conn_def(str_src_conn_params_p src_conn_params) {

if (NULL == src_conn_params)
return;
mem_bzero(src_conn_params, sizeof(str_src_conn_params_t));
memset(src_conn_params, 0x00, sizeof(str_src_conn_params_t));
src_conn_params->mc.if_index = STR_SRC_CONN_DEF_IFINDEX;
src_conn_params->mc.rejoin_time = 0;
}
Expand All @@ -182,11 +182,11 @@ str_hubs_bckt_create(tp_p tp, const char *app_ver, str_hub_settings_p hub_params

if (NULL == shbskt_ret)
return (EINVAL);
shbskt = zalloc(sizeof(str_hubs_bckt_t) + hub_params->cust_http_hdrs_size + sizeof(void*));
shbskt = calloc(1, sizeof(str_hubs_bckt_t) + hub_params->cust_http_hdrs_size + sizeof(void*));
if (NULL == shbskt)
return (ENOMEM);
thread_count_max = tp_thread_count_max_get(tp);
shbskt->thr_data = zalloc((sizeof(str_hub_thrd_t) * thread_count_max));
shbskt->thr_data = calloc(1, (sizeof(str_hub_thrd_t) * thread_count_max));
if (NULL == shbskt->thr_data) {
error = ENOMEM;
goto err_out;
Expand Down Expand Up @@ -359,7 +359,7 @@ str_hubs_bckt_stat_summary(str_hubs_bckt_p shbskt, str_hubs_stat_p stat) {
if (NULL == shbskt || NULL == stat)
return (EINVAL);
thread_cnt = tp_thread_count_max_get(shbskt->tp);
mem_bzero(stat, sizeof(str_hubs_stat_t));
memset(stat, 0x00, sizeof(str_hubs_stat_t));
for (i = 0; i < thread_cnt; i ++) {
stat->str_hub_count += shbskt->thr_data[i].stat.str_hub_count;
stat->cli_count += shbskt->thr_data[i].stat.cli_count;
Expand Down Expand Up @@ -435,7 +435,7 @@ str_hubs_bckt_timer_msg_cb(tpt_p tpt, void *udata) {

//SYSLOGD_EX(LOG_DEBUG, "...");
thread_num = tp_thread_get_num(tpt);
mem_bzero(&stat, sizeof(str_hubs_stat_t));
memset(&stat, 0x00, sizeof(str_hubs_stat_t));

/* Enum all Stream Hubs associated with this thread. */
TAILQ_FOREACH_SAFE(str_hub, &shbskt->thr_data[thread_num].hub_head, next,
Expand Down Expand Up @@ -473,7 +473,7 @@ str_hub_create_int(str_hubs_bckt_p shbskt, tpt_p tpt, uint8_t *name, size_t name

if (NULL == shbskt || NULL == name || 0 == name_size || NULL == str_hub_ret)
return (EINVAL);
str_hub = zalloc((sizeof(str_hub_t) + name_size + sizeof(void*)));
str_hub = calloc(1, (sizeof(str_hub_t) + name_size + sizeof(void*)));
if (NULL == str_hub)
return (ENOMEM);

Expand Down Expand Up @@ -577,7 +577,7 @@ str_hub_cli_alloc(uintptr_t skt, const char *ua, size_t ua_size) {

if (STR_HUB_CLI_USER_AGENT_MAX_SIZE < ua_size)
ua_size = STR_HUB_CLI_USER_AGENT_MAX_SIZE;
strh_cli = zalloc(sizeof(str_hub_cli_t) + ua_size + sizeof(void*));
strh_cli = calloc(1, sizeof(str_hub_cli_t) + ua_size + sizeof(void*));
if (NULL == strh_cli)
return (NULL);
/* Set. */
Expand Down Expand Up @@ -615,7 +615,7 @@ str_hub_cli_destroy(str_hub_p str_hub, str_hub_cli_p strh_cli) {
/* Send HTTP headers if needed. */
if (0 == (STR_HUB_CLI_STATE_F_HTTP_HDRS_SENDED & strh_cli->flags) &&
0 == strh_cli->offset) {
mem_bzero(&mhdr, sizeof(mhdr));
memset(&mhdr, 0x00, sizeof(mhdr));
mhdr.msg_iov = (struct iovec*)iov;

iov[mhdr.msg_iovlen].iov_base = MK_RW_PTR("HTTP/1.1 503 Service Unavailable\r\n");
Expand Down Expand Up @@ -647,7 +647,7 @@ str_hub_cli_attach(str_hubs_bckt_p shbskt, str_hub_cli_p strh_cli,
if (NULL == shbskt || NULL == strh_cli || NULL == hub_name ||
0 == hub_name_size || NULL == src_conn_params)
return (EINVAL);
cli_data = zalloc(sizeof(str_hub_cli_attach_cb_data_t) + hub_name_size + sizeof(void*));
cli_data = calloc(1, sizeof(str_hub_cli_attach_cb_data_t) + hub_name_size + sizeof(void*));
if (NULL == cli_data)
return (ENOMEM);
cli_data->shbskt = shbskt;
Expand Down Expand Up @@ -806,7 +806,7 @@ str_hub_send_to_clients(str_hub_p str_hub) {
transfered_size = 0;
/* Send HTTP headers if needed. */
if (0 == (STR_HUB_CLI_STATE_F_HTTP_HDRS_SENDED & strh_cli->flags)) {
mem_bzero(&mhdr, sizeof(mhdr));
memset(&mhdr, 0x00, sizeof(mhdr));
mhdr.msg_iov = (struct iovec*)iov;
mhdr.msg_iovlen = 3;
iov[0].iov_base = MK_RW_PTR("HTTP/1.1 200 OK\r\n");
Expand Down

0 comments on commit e414757

Please sign in to comment.