Browse code

core: events - rename SREV_NET_DATA_SEND to SREV_NET_DATA_SENT

- reflects better the purpose, being executed after the message is sent

Daniel-Constantin Mierla authored on 24/03/2021 08:04:38
Showing 3 changed files
... ...
@@ -175,9 +175,9 @@ int sr_event_register_cb(int type, sr_event_cb_f f)
175 175
 					_sr_events_list.net_data_recv = f;
176 176
 				else return -1;
177 177
 			break;
178
-		case SREV_NET_DATA_SEND:
179
-				if(_sr_events_list.net_data_send==0)
180
-					_sr_events_list.net_data_send = f;
178
+		case SREV_NET_DATA_SENT:
179
+				if(_sr_events_list.net_data_sent==0)
180
+					_sr_events_list.net_data_sent = f;
181 181
 				else return -1;
182 182
 			break;
183 183
 		case SREV_SIP_REPLY_OUT:
... ...
@@ -329,10 +329,10 @@ int sr_event_exec(int type, sr_event_param_t *evp)
329 329
 					ret = _sr_events_list.net_data_recv(evp);
330 330
 					return ret;
331 331
 				} else return 1;
332
-		case SREV_NET_DATA_SEND:
333
-				if(unlikely(_sr_events_list.net_data_send!=0))
332
+		case SREV_NET_DATA_SENT:
333
+				if(unlikely(_sr_events_list.net_data_sent!=0))
334 334
 				{
335
-					ret = _sr_events_list.net_data_send(evp);
335
+					ret = _sr_events_list.net_data_sent(evp);
336 336
 					return ret;
337 337
 				} else return 1;
338 338
 		case SREV_SIP_REPLY_OUT:
... ...
@@ -394,8 +394,8 @@ int sr_event_enabled(int type)
394 394
 				return (_sr_events_list.tcp_closed!=0)?1:0;
395 395
 		case SREV_NET_DATA_RECV:
396 396
 				return (_sr_events_list.net_data_recv!=0)?1:0;
397
-		case SREV_NET_DATA_SEND:
398
-				return (_sr_events_list.net_data_send!=0)?1:0;
397
+		case SREV_NET_DATA_SENT:
398
+				return (_sr_events_list.net_data_sent!=0)?1:0;
399 399
 		case SREV_SIP_REPLY_OUT:
400 400
 				return (_sr_events_list.sip_reply_out[0]!=0)?1:0;
401 401
 		case SREV_TCP_WS_CLOSE:
... ...
@@ -36,7 +36,7 @@
36 36
 #define SREV_STUN_IN			12
37 37
 #define SREV_TCP_CLOSED			13
38 38
 #define SREV_NET_DATA_RECV		14
39
-#define SREV_NET_DATA_SEND		15
39
+#define SREV_NET_DATA_SENT		15
40 40
 #define SREV_SIP_REPLY_OUT		16
41 41
 #define SREV_TCP_WS_CLOSE		17
42 42
 
... ...
@@ -70,7 +70,7 @@ typedef struct sr_event_cb {
70 70
 	sr_event_cb_f rcv_nosip;
71 71
 	sr_event_cb_f tcp_closed;
72 72
 	sr_event_cb_f net_data_recv;
73
-	sr_event_cb_f net_data_send;
73
+	sr_event_cb_f net_data_sent;
74 74
 	sr_event_cb_f sip_reply_out[SREV_CB_LIST_SIZE];
75 75
 	sr_event_cb_f tcp_ws_close[SREV_CB_LIST_SIZE];
76 76
 } sr_event_cb_t;
... ...
@@ -331,7 +331,7 @@ done:
331 331
 		netinfo.data.len = outb.len;
332 332
 		netinfo.dst = dst;
333 333
 		evp.data = (void*)&netinfo;
334
-		sr_event_exec(SREV_NET_DATA_SEND, &evp);
334
+		sr_event_exec(SREV_NET_DATA_SENT, &evp);
335 335
 	}
336 336
 
337 337
 	if(outb.s != buf)