[OpenSIPS-Devel] [OpenSIPS/opensips] 38ec51: core: GC unused function

Maksym Sobolyev noreply at github.com
Sat Dec 2 06:27:27 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 38ec51c7e81381c7e0393f425fa52e1401a02bba
      https://github.com/OpenSIPS/opensips/commit/38ec51c7e81381c7e0393f425fa52e1401a02bba
  Author: Maksym Sobolyev <sobomax at sippysoft.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    M resolve.c
    M resolve.h

  Log Message:
  -----------
  core: GC unused function


  Commit: f66b96596fbfd2731bede512ae12bde875d25fda
      https://github.com/OpenSIPS/opensips/commit/f66b96596fbfd2731bede512ae12bde875d25fda
  Author: Maksym Sobolyev <sobomax at sippysoft.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    M modules/proto_msrp/msrp_common.c

  Log Message:
  -----------
  proto_msrp: include timer.h to get get_ticks() prototype


  Commit: 034fa786160146c0c961281230200a9dd50b92ed
      https://github.com/OpenSIPS/opensips/commit/034fa786160146c0c961281230200a9dd50b92ed
  Author: Maksym Sobolyev <sobomax at sippysoft.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    M modules/cgrates/cgrates_engine.c

  Log Message:
  -----------
  cgrates: fix cgr_conn_schedule() -> nop() workaround


  Commit: a4b1263a9d264daa6a3cfc75413b7d8b42d0ee11
      https://github.com/OpenSIPS/opensips/commit/a4b1263a9d264daa6a3cfc75413b7d8b42d0ee11
  Author: Maksym Sobolyev <sobomax at sippysoft.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    M modules/emergency/Makefile
    M modules/presence/Makefile
    M modules/siprec/Makefile

  Log Message:
  -----------
  emergency,presence,siprec: also look for includes and libs in ${LOCALBASE}


  Commit: 5dc91d374a123c11b9c272c2637e46dd73b94bca
      https://github.com/OpenSIPS/opensips/commit/5dc91d374a123c11b9c272c2637e46dd73b94bca
  Author: Maksym Sobolyev <sobomax at sippysoft.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    M Makefile.defs

  Log Message:
  -----------
  core: make working on the system with just a cc or clang and no gcc


  Commit: bb300aeb91e2c344583f2082d9de88b117ca1d6b
      https://github.com/OpenSIPS/opensips/commit/bb300aeb91e2c344583f2082d9de88b117ca1d6b
  Author: Maksym Sobolyev <sobomax at sippysoft.com>
  Date:   2023-12-01 (Fri, 01 Dec 2023)

  Changed paths:
    M core_cmds.c
    M dset.c
    M dset.h
    M forward.c
    M forward.h
    M globals.c
    M globals.h
    M ip_addr.c
    M ip_addr.h
    M mi/mi_trace.c
    M mi/mi_trace.h
    M modules/b2b_entities/b2be_clustering.c
    M modules/b2b_entities/b2be_load.h
    M modules/b2b_entities/dlg.h
    M modules/b2b_logic/logic.c
    M modules/b2b_sdp_demux/b2b_sdp_demux.c
    M modules/clusterer/node_info.h
    M modules/dialog/dlg_db_handler.c
    M modules/dialog/dlg_hash.c
    M modules/dialog/dlg_hash.h
    M modules/dialog/dlg_replication.c
    M modules/dispatcher/dispatch.c
    M modules/dispatcher/dispatch.h
    M modules/dispatcher/dispatcher.c
    M modules/domainpolicy/domainpolicy.c
    M modules/drouting/dr_load.c
    M modules/drouting/drouting.c
    M modules/drouting/prefix_tree.h
    M modules/drouting/routing.c
    M modules/drouting/routing.h
    M modules/emergency/sip_emergency.c
    M modules/lua/sipapi.c
    M modules/media_exchange/media_exchange.c
    M modules/mi_script/mi_script.c
    M modules/mid_registrar/save.c
    M modules/msrp_relay/msrp_relay.c
    M modules/msrp_ua/msrp_ua.c
    M modules/nat_traversal/nat_traversal.c
    M modules/nathelper/nathelper.c
    M modules/nathelper/sip_pinger.h
    M modules/presence/subscribe.h
    M modules/presence/utils_func.h
    M modules/proto_bin/proto_bin.c
    M modules/proto_bins/proto_bins.c
    M modules/proto_hep/hep.c
    M modules/proto_hep/proto_hep.c
    M modules/proto_msrp/msrp_api.h
    M modules/proto_msrp/msrp_common.c
    M modules/proto_msrp/msrp_common.h
    M modules/proto_msrp/msrp_signaling.c
    M modules/proto_msrp/msrp_signaling.h
    M modules/proto_msrp/proto_msrp.c
    M modules/proto_sctp/proto_sctp.c
    M modules/proto_sctp/sctp_server.c
    M modules/proto_sctp/sctp_server.h
    M modules/proto_smpp/proto_smpp.c
    M modules/proto_smpp/smpp.c
    M modules/proto_tls/proto_tls.c
    M modules/proto_ws/proto_ws.c
    M modules/proto_ws/ws_common.h
    M modules/proto_wss/proto_wss.c
    M modules/registrar/reg_mod.c
    M modules/registrar/reply.c
    M modules/registrar/save.c
    M modules/rls/subscribe.c
    M modules/rr/loose.c
    M modules/sipcapture/sipcapture.c
    M modules/siprec/siprec_sess.c
    M modules/siprec/siprec_sess.h
    M modules/siprec/siprec_var.c
    M modules/siprec/siprec_var.h
    M modules/stun/stun.c
    M modules/stun/stun.h
    M modules/tcp_mgm/tcp_path.c
    M modules/tcp_mgm/tcp_path.h
    M modules/tm/async.c
    M modules/tm/callid.c
    M modules/tm/dlg.c
    M modules/tm/dlg.h
    M modules/tm/mi.c
    M modules/tm/t_fwd.c
    M modules/tm/t_msgbuilder.c
    M modules/tm/t_reply.c
    M modules/tm/uac.c
    M modules/tm/ut.h
    M modules/topology_hiding/topo_hiding_logic.c
    M modules/tracer/tracer.c
    M modules/uac_registrant/reg_records.h
    M modules/usrloc/dlist.c
    M modules/usrloc/ucontact.h
    M modules/usrloc/ul_evi.c
    M msg_translator.c
    M msg_translator.h
    M net/api_proto.h
    M net/api_proto_net.h
    M net/net_tcp.c
    M net/net_tcp.h
    M net/net_tcp_proc.c
    M net/net_udp.c
    M net/proto_tcp/proto_tcp.c
    M net/proto_udp/proto_udp.c
    M net/tcp_common.c
    M net/tcp_common.h
    M net/tcp_conn_profile.c
    M net/tcp_conn_profile.h
    M net/trans.c
    M net/trans.h
    M parser/msg_parser.h
    M pvar.c
    M serialize.c
    M sl_cb.c
    M sl_cb.h
    M socket_info.c
    M socket_info.h
    M tags.h
    M trace_api.h

  Log Message:
  -----------
  core: make sockaddr_union* and socket_info* arguments, vars and members const

Make the said pointers const in most places where appropriate. This basically
ensures that code in modules cannot mess with them intentionally or by a
mistake.

It should also have some positive effect on the performance of the code, as
with those being const * the optimizer would have more room to speculate
about what code might and might not do.

There might be also some improvement of static analysis front.

Most of the change is pretty mechanical, the only functional change is
the allocation of the socket_info.last_real_port, since those are expected
to be updated by the underlying protos/modules. Work around that by
making a separate smaller struct last_real_ports and co-allocate it along
with the socket_info main backing storage, exposing the non-const pointer
to that instead.

Move the prev / next into the semi-private part of the struct.

Rework net/api_proto_net.h to not require casting handler functions
to a generic type.

Next step would be make str members of socket_info into str_const.

Tested with voiptests.


Compare: https://github.com/OpenSIPS/opensips/compare/d8323704b05a...bb300aeb91e2



More information about the Devel mailing list