Skip to content

Commit e38b71b

Browse files
committed
receive_msg: receive custom message flags
1 parent f59716f commit e38b71b

File tree

9 files changed

+11
-10
lines changed

9 files changed

+11
-10
lines changed

modules/proto_hep/proto_hep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ static inline int hep_handle_req(struct tcp_req *req,
977977

978978
/* skip receive msg if we were told so from at least one callback */
979979
if ( ret != HEP_SCRIPT_SKIP ) {
980-
if ( receive_msg(msg_buf, msg_len, &local_rcv, ctx) <0 ) {
980+
if ( receive_msg(msg_buf, msg_len, &local_rcv, ctx, 0) <0 ) {
981981
LM_ERR("receive_msg failed \n");
982982
}
983983
} else {
@@ -1312,7 +1312,7 @@ static int hep_udp_read_req(struct socket_info *si, int* bytes_read)
13121312

13131313
if (ret != HEP_SCRIPT_SKIP) {
13141314
/* receive_msg must free buf too!*/
1315-
receive_msg( msg.s, msg.len, &ri, ctx);
1315+
receive_msg( msg.s, msg.len, &ri, ctx, 0);
13161316
} else {
13171317
if ( ctx ) {
13181318
context_free( ctx );

modules/proto_sctp/sctp_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ int proto_sctp_read(struct socket_info *si, int* bytes_read)
182182
}
183183

184184
/* receive_msg must free buf too!*/
185-
receive_msg(buf, len, &ri, NULL);
185+
receive_msg(buf, len, &ri, NULL, 0);
186186

187187
return 0;
188188
}

modules/proto_ws/ws_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static int ws_process(struct tcp_connection *con)
528528
"keeping connection \n");
529529
}
530530

531-
if (receive_msg(msg_buf, msg_len, &local_rcv, NULL) <0)
531+
if (receive_msg(msg_buf, msg_len, &local_rcv, NULL, 0) <0)
532532
LM_ERR("receive_msg failed \n");
533533

534534
*req->tcp.parsed = bk;

modules/sipcapture/sipcapture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5546,7 +5546,7 @@ int raw_capture_rcv_loop(int rsock, int port1, int port2, int ipip) {
55465546
if((!port1 && !port2)
55475547
|| (src_port >= port1 && src_port <= port2) || (dst_port >= port1 && dst_port <= port2)
55485548
|| (!port2 && (src_port == port1 || dst_port == port1)))
5549-
receive_msg(buf+offset, len, &ri, NULL);
5549+
receive_msg(buf+offset, len, &ri, NULL, 0);
55505550
}
55515551

55525552
return 0;

modules/tm/cluster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static void tm_repl_received(bin_packet_t *packet)
7878
/* TODO: mark the packet as replicated, to make sure we don't replicate it again */
7979

8080
/* all set up - process it */
81-
receive_msg(tmp.s, tmp.len, &ri, NULL);
81+
receive_msg(tmp.s, tmp.len, &ri, NULL, FL_TM_REPLICATED);
8282
}
8383
#undef TM_BIN_POP
8484

net/proto_tcp/tcp_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static inline int tcp_handle_req(struct tcp_req *req,
409409
}
410410

411411
if (receive_msg(msg_buf, msg_len,
412-
&local_rcv, NULL) <0)
412+
&local_rcv, NULL, 0) <0)
413413
LM_ERR("receive_msg failed \n");
414414

415415
if (!size && req != &_tcp_common_current_req) {

net/proto_udp/proto_udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int udp_read_req(struct socket_info *si, int* bytes_read)
178178
}
179179

180180
/* receive_msg must free buf too!*/
181-
receive_msg( msg.s, msg.len, &ri, NULL);
181+
receive_msg( msg.s, msg.len, &ri, NULL, 0);
182182

183183
return 0;
184184
}

receive.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ unsigned int get_next_msg_no(void)
9797
* break (e.g.: modules/textops)
9898
*/
9999
int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info,
100-
context_p existing_context)
100+
context_p existing_context, unsigned int flags)
101101
{
102102
static context_p ctx = NULL;
103103
struct sip_msg* msg;
@@ -139,6 +139,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info,
139139
msg->len=len;
140140
msg->rcv=*rcv_info;
141141
msg->id=msg_no;
142+
msg->flags=flags;
142143
msg->ruri_q = Q_UNSPECIFIED;
143144

144145
if (parse_msg(in_buff.s,len, msg)!=0){

receive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "context.h"
3232

3333
int receive_msg(char* buf, unsigned int len, struct receive_info *ri,
34-
context_p existing_context);
34+
context_p existing_context, unsigned int flags);
3535

3636
unsigned int get_next_msg_no(void);
3737

0 commit comments

Comments
 (0)