Skip to content

Commit 10d4fdf

Browse files
lemenkovorgads
authored andcommitted
Remove unused compression plugin support
The compression plugin infrastructure (-c option) was added in 2003 but no sippcomp.so plugin was ever distributed with SIPp. This was likely intended for SigComp (RFC 3320, updated by RFC 4896) support that never materialized. If SigComp support is desired in the future, it should be implemented properly as a built-in feature rather than through an undocumented plugin interface. Signed-off-by: Peter Lemenkov <lemenkov@gmail.com> Assisted-by: Claude (Anthropic) <https://claude.ai>
1 parent 1cb1b61 commit 10d4fdf

9 files changed

Lines changed: 1 addition & 193 deletions

File tree

include/call.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ class call : virtual public task, virtual public listener, public virtual socket
220220
SIPpSocket *call_remote_socket;
221221
int call_port;
222222

223-
void * comp_state;
224-
225223
int deleted;
226224

227225
bool call_established; // == true when the call is established

include/comp.h

Lines changed: 0 additions & 70 deletions
This file was deleted.

include/sipp.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
#include "socket.hpp"
7272
#include "socketowner.hpp"
7373
#include "call.hpp"
74-
#include "comp.h"
7574
#include "variables.hpp"
7675
#include "stat.hpp"
7776
#include "actions.hpp"
@@ -199,7 +198,6 @@ MAYBE_EXTERN unsigned long deadcall_wait DEFVAL(DEFAULT_DEADCALL_
199198
MAYBE_EXTERN bool pause_msg_ign DEFVAL(0);
200199
MAYBE_EXTERN bool auto_answer DEFVAL(false);
201200
MAYBE_EXTERN int multisocket DEFVAL(0);
202-
MAYBE_EXTERN int compression DEFVAL(0);
203201
MAYBE_EXTERN int peripsocket DEFVAL(0);
204202
MAYBE_EXTERN int peripfield DEFVAL(0);
205203
MAYBE_EXTERN bool bind_local DEFVAL(false);

include/socket.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ class SIPpSocket {
106106
int ss_fd = -1; /* The underlying file descriptor for this socket. */
107107
int ss_port = 0; /* The port used by this socket */
108108
int ss_bind_port = 0; /* Optional local port used by this socket */
109-
void *ss_comp_state = nullptr; /* The compression state. */
110109

111110
bool ss_changed_dest = false; /* Has the destination changed from default. */
112111
struct sockaddr_storage ss_dest; /* Who we are talking to. */
@@ -163,11 +162,6 @@ bool reconnect_allowed();
163162

164163
/********************** Network Interfaces ********************/
165164

166-
int send_message(int s, void ** comp_state, char * msg);
167-
#if defined(USE_OPENSSL) || defined(USE_WOLFSSL)
168-
int send_message_tls(SSL *s, void ** comp_state, char * msg);
169-
#endif
170-
171165
/* Socket Buffer Management. */
172166
#define NO_COPY 0
173167
#define DO_COPY 1

src/call.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,6 @@ void call::init(scenario * call_scenario, SIPpSocket *socket, struct sockaddr_st
886886
paused_until = 0;
887887

888888
call_port = 0;
889-
comp_state = nullptr;
890889

891890
start_time = clock_tick;
892891
call_established=false ;
@@ -1147,10 +1146,6 @@ call::~call()
11471146
{
11481147
computeStat(CStat::E_ADD_CALL_DURATION, clock_tick - start_time);
11491148

1150-
if(comp_state) {
1151-
comp_free(&comp_state);
1152-
}
1153-
11541149
if (call_remote_socket && (call_remote_socket != main_remote_socket)) {
11551150
call_remote_socket->close();
11561151
}
@@ -1431,9 +1426,6 @@ int call::send_raw(const char * msg, int index, int len)
14311426
callDebug("%s message voluntary lost (while sending) (index %d, hash %lu).\n",
14321427
TRANSPORT_TO_STRING(transport), index, hash(msg));
14331428

1434-
if(comp_state) {
1435-
comp_free(&comp_state);
1436-
}
14371429
call_scenario->messages[index] -> nb_lost++;
14381430
return 0;
14391431
}
@@ -4542,9 +4534,6 @@ bool call::process_incoming(const char* msg, const struct sockaddr_storage* src)
45424534
TRANSPORT_TO_STRING(transport));
45434535
callDebug("%s message (retrans) lost (recv) (hash %lu)\n", TRANSPORT_TO_STRING(transport), hash(msg));
45444536

4545-
if(comp_state) {
4546-
comp_free(&comp_state);
4547-
}
45484537
call_scenario->messages[recv_retrans_recv_index] -> nb_lost++;
45494538
return true;
45504539
}
@@ -5365,9 +5354,6 @@ bool call::process_incoming(const char* msg, const struct sockaddr_storage* src)
53655354
TRANSPORT_TO_STRING(transport));
53665355
callDebug("%s message lost (recv) (hash %lu).\n",
53675356
TRANSPORT_TO_STRING(transport), hash(msg));
5368-
if(comp_state) {
5369-
comp_free(&comp_state);
5370-
}
53715357
call_scenario->messages[search_index] -> nb_lost++;
53725358
return true;
53735359
}

src/comp.c

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/screen.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,6 @@ void ScreenPrinter::draw_scenario_screen()
374374
}
375375
lines.push_back(buf);
376376

377-
if (compression) {
378-
snprintf(buf, bufsiz, " Comp resync: %d sent, %d recv", resynch_send,
379-
resynch_recv);
380-
lines.push_back(buf);
381-
}
382-
383377
if (auto_answer) {
384378
snprintf(buf, 80, " %llu requests auto-answered",
385379
display_scenario->stats->GetStat(CStat::CPT_G_C_AutoAnswered));

src/sipp.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ struct sipp_option options_table[] = {
169169
"- s1: SCTP with one socket,\n"
170170
"- sn: SCTP with one socket per call,\n"
171171
#endif
172-
"- c1: u1 + compression (only if compression plugin loaded),\n"
173-
"- cn: un + compression (only if compression plugin loaded). This plugin is not provided with SIPp.\n"
174172
, SIPP_OPTION_TRANSPORT, nullptr, 1
175173
},
176174
{"i", "Set the local IP address for 'Contact:','Via:', and 'From:' headers. Default is primary host IP address.\n", SIPP_OPTION_IP, local_ip, 1},
@@ -347,7 +345,7 @@ struct sipp_option options_table[] = {
347345
{"", "Performance and watchdog options:", SIPP_HELP_TEXT_HEADER, nullptr, 0},
348346
{"timer_resol", "Set the timer resolution. Default unit is milliseconds. This option has an impact on timers precision."
349347
"Small values allow more precise scheduling but impacts CPU usage."
350-
"If the compression is on, the value is set to 50ms. The default value is 10ms.", SIPP_OPTION_TIME_MS, &timer_resolution, 1},
348+
"The default value is 10ms.", SIPP_OPTION_TIME_MS, &timer_resolution, 1},
351349
{"max_recv_loops", "Set the maximum number of messages received read per cycle. Increase this value for high traffic level. The default value is 1000.", SIPP_OPTION_INT, &max_recv_loops, 1},
352350
{"max_sched_loops", "Set the maximum number of calls run per event loop. Increase this value for high traffic level. The default value is 1000.", SIPP_OPTION_INT, &max_sched_loops, 1},
353351

@@ -1622,12 +1620,6 @@ int main(int argc, char *argv[])
16221620
exit(-1);
16231621
}
16241622
break;
1625-
case 'c':
1626-
if (strlen(comp_error)) {
1627-
ERROR("No " COMP_PLUGIN " plugin available: %s", comp_error);
1628-
}
1629-
transport = T_UDP;
1630-
compression = 1;
16311623
}
16321624
switch(argv[argi][1]) {
16331625
case '1':
@@ -1953,13 +1945,6 @@ int main(int argc, char *argv[])
19531945
global_ssrc_id = 0xCA110000;
19541946
}
19551947

1956-
/* Load compression plugin if needed/available. */
1957-
if (compression) {
1958-
if (comp_load()) {
1959-
ERROR("Could not load " COMP_PLUGIN " plugin: %s", comp_error);
1960-
}
1961-
}
1962-
19631948
if ((extendedTwinSippMode && !slave_masterSet) || (!extendedTwinSippMode && slave_masterSet)) {
19641949
ERROR("-slave_cfg option must be used with -slave or -master option");
19651950
}

src/socket.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,19 +2141,6 @@ ssize_t SIPpSocket::write_primitive(const char* buffer, size_t len,
21412141
break;
21422142

21432143
case T_UDP:
2144-
if (compression) {
2145-
static char comp_msg[SIPP_MAX_MSG_SIZE];
2146-
strncpy(comp_msg, buffer, sizeof(comp_msg) - 1);
2147-
if (comp_compress(&ss_comp_state,
2148-
comp_msg,
2149-
(unsigned int *) &len) != COMP_OK) {
2150-
ERROR("Compression plugin error");
2151-
}
2152-
buffer = (char *)comp_msg;
2153-
2154-
TRACE_MSG("---\nCompressed message len: %zu\n", len);
2155-
}
2156-
21572144
rc = sendto(ss_fd, buffer, len, 0, _RCAST(struct sockaddr*, dest),
21582145
socklen_from_addr(dest));
21592146
break;

0 commit comments

Comments
 (0)