Ver código fonte

tm: remove #define WITH_AS_SUPPORT, activated and unchanged since 2009

- remove #define WITH_AS_SUPPORT, activated and unchanged since 2009
- introduced in commit d65cdd3fd4ad8faab497
- without it some modules (e.g. ims_dialog, seas) also not compile anymore
Henning Westerholt 6 anos atrás
pai
commit
38be6c77e6

+ 0 - 2
src/modules/tm/h_table.c

@@ -234,10 +234,8 @@ void free_cell_helper(
 		}
 	}
 
-#ifdef WITH_AS_SUPPORT
 	if(dead_cell->uac[0].local_ack)
 		free_local_ack_unsafe(dead_cell->uac[0].local_ack);
-#endif
 
 	/* collected to tags */
 	tt = dead_cell->fwded_totags;

+ 0 - 6
src/modules/tm/h_table.h

@@ -217,7 +217,6 @@ typedef struct ua_client
 	/* internal processing code - (mapping over sip warning codes)
 	 * - storing the code giving a clue of what happened internally */
 	int icode;
-#ifdef WITH_AS_SUPPORT
 	/**
 	 * Resent for every rcvd 2xx reply.
 	 * This member's as an alternative to passing the reply to the AS,
@@ -226,7 +225,6 @@ typedef struct ua_client
 	 * concurrently with a 2xx reply (to generate an ACK).
 	 */
 	struct retr_buf *local_ack;
-#endif
 	/* the route to take if no final positive reply arrived */
 	unsigned short on_failure;
 	/* the route to take for all failure replies */
@@ -274,21 +272,17 @@ typedef struct async_state
 #define T_IN_AGONY (1 << 5)		/* set if waiting to die (delete timer)
 								 * TODO: replace it with del on unref */
 #define T_AUTO_INV_100 (1 << 6) /* send an 100 reply automatically  to inv. */
-#ifdef WITH_AS_SUPPORT
 /* don't generate automatically an ACK for local transaction */
 #define T_NO_AUTO_ACK (1 << 7)
-#endif
 
 #define T_DISABLE_6xx (1 << 8)		/* treat 6xx as a normal reply */
 #define T_DISABLE_FAILOVER (1 << 9) /* don't perform dns failover */
 #define T_NO_E2E_CANCEL_REASON (1 << 10) /* don't propagate CANCEL Reason */
 #define T_DONT_FORK (T_CANCELED | T_6xx)
 
-#ifdef WITH_AS_SUPPORT
 /* provisional replies must trigger callbacks for local transaction */
 #define T_PASS_PROVISIONAL_FLAG (1 << 11)
 #define pass_provisional(_t_) ((_t_)->flags & T_PASS_PROVISIONAL_FLAG)
-#endif
 #define T_ASYNC_CONTINUE \
 	(1 << 12) /* Is this transaction in a continuation after being suspended */
 

+ 0 - 4
src/modules/tm/t_hooks.h

@@ -54,9 +54,7 @@ struct cell;
 #define TMCB_E2ECANCEL_IN_N     18
 #define TMCB_E2EACK_RETR_IN_N   19
 #define TMCB_RESPONSE_READY_N	20
-#ifdef WITH_AS_SUPPORT
 #define TMCB_DONT_ACK_N         21 /* TM shoudn't ACK a local UAC  */
-#endif
 #define TMCB_REQUEST_SENT_N     22
 #define TMCB_RESPONSE_SENT_N    23
 #define TMCB_ON_BRANCH_FAILURE_RO_N 24
@@ -85,9 +83,7 @@ struct cell;
 #define TMCB_E2ECANCEL_IN     (1<<TMCB_E2ECANCEL_IN_N)
 #define TMCB_E2EACK_RETR_IN   (1<<TMCB_E2EACK_RETR_IN_N)
 #define TMCB_RESPONSE_READY   (1<<TMCB_RESPONSE_READY_N)
-#ifdef WITH_AS_SUPPORT
 #define TMCB_DONT_ACK         (1<<TMCB_DONT_ACK_N)
-#endif
 #define TMCB_REQUEST_SENT      (1<<TMCB_REQUEST_SENT_N)
 #define TMCB_RESPONSE_SENT     (1<<TMCB_RESPONSE_SENT_N)
 #define TMCB_ON_BRANCH_FAILURE (1<<TMCB_ON_BRANCH_FAILURE_N)

+ 0 - 2
src/modules/tm/t_lookup.c

@@ -1537,7 +1537,6 @@ int t_get_trans_ident(struct sip_msg* p_msg, unsigned int* hash_index, unsigned
 	return 1;
 }
 
-#ifdef WITH_AS_SUPPORT
 /**
  * Returns the hash coordinates of the transaction current CANCEL is targeting.
  */
@@ -1560,7 +1559,6 @@ int t_get_canceled_ident(struct sip_msg* msg, unsigned int* hash_index,
 	UNREF(orig);
 	return 1;
 }
-#endif /* WITH_AS_SUPPORT */
 
 
 

+ 0 - 2
src/modules/tm/t_lookup.h

@@ -103,7 +103,6 @@ int t_set_max_lifetime(struct sip_msg* msg, unsigned int eol_inv,
 											unsigned int eol_noninv);
 int t_reset_max_lifetime(void);
 
-#ifdef WITH_AS_SUPPORT
 /**
  * Returns the hash coordinates of the transaction current CANCEL is targeting.
  */
@@ -111,7 +110,6 @@ int t_get_canceled_ident(struct sip_msg *msg, unsigned int *hash_index,
 		unsigned int *label);
 typedef int (*t_get_canceled_ident_f)(struct sip_msg *msg, 
 		unsigned int *hash_index, unsigned int *label);
-#endif /* WITH_AS_SUPPORT */
 
 /**
  * required by TMX (K/O extensions)

+ 0 - 6
src/modules/tm/t_msgbuilder.c

@@ -1073,7 +1073,6 @@ char *build_dlg_ack(struct sip_msg* rpl, struct cell *Trans,
 #ifdef USE_DNS_FAILOVER
 	struct dns_srv_handle dns_h;
 #endif
-#ifdef WITH_AS_SUPPORT
 	/* With AS support, TM allows for external modules to generate building of
 	 * the ACK; in this case, the ACK's retransmission buffer is built once
 	 * and kept in memory (to help when retransmitted 2xx are received and ACK
@@ -1087,7 +1086,6 @@ char *build_dlg_ack(struct sip_msg* rpl, struct cell *Trans,
 	 * 'out' to return the length of the allocated string buffer.
 	 */
 	unsigned offset = *len;
-#endif
 
 	if (parse_headers(rpl, HDR_EOH_F, 0) == -1 || !rpl->to) {
 		LM_ERR("Error while parsing headers.\n");
@@ -1203,12 +1201,8 @@ char *build_dlg_ack(struct sip_msg* rpl, struct cell *Trans,
 	/* Content Length, EoM */
 	*len += CONTENT_LENGTH_LEN + body_len.len + CRLF_LEN + CRLF_LEN;
 
-#if WITH_AS_SUPPORT
 	req_buf = shm_malloc(offset + *len + 1);
 	req_buf += offset;
-#else
-	req_buf = shm_malloc(*len + 1);
-#endif
 	if (!req_buf) {
 		LM_ERR("Cannot allocate memory (%u+1)\n", *len);
 		goto error01;

+ 0 - 12
src/modules/tm/t_reply.c

@@ -376,7 +376,6 @@ static char *build_local_ack(struct sip_msg* rpl, struct cell *trans,
 								int branch, unsigned int *ret_len,
 								struct dest_info*  dst)
 {
-#ifdef WITH_AS_SUPPORT
 	struct retr_buf *local_ack, *old_lack;
 
 	/* do we have the ACK cache, previously build? */
@@ -414,10 +413,6 @@ static char *build_local_ack(struct sip_msg* rpl, struct cell *trans,
 	*ret_len = local_ack->buffer_len;
 	*dst = local_ack->dst;
 	return local_ack->buffer;
-#else /* ! WITH_AS_SUPPORT */
-	return build_dlg_ack(rpl, trans, branch, /*hdrs*/NULL, /*body*/NULL,
-			ret_len, dst);
-#endif /* WITH_AS_SUPPORT */
 }
 
 
@@ -1483,14 +1478,10 @@ static enum rps t_should_relay_response( struct cell *Trans , int new_code,
 
 	/* not >=300 ... it must be 2xx or provisional 1xx */
 	if (new_code>=100) {
-#ifdef WITH_AS_SUPPORT
 			/* need a copy of the message for ACK generation */
 			*should_store = (inv_through && is_local(Trans) &&
 					(Trans->uac[branch].last_received < 200) &&
 					(Trans->flags & T_NO_AUTO_ACK)) ? 1 : 0;
-#else
-		*should_store=0;
-#endif
 		/* By default, 1xx and 2xx (except 100) will be relayed. 100 relaying can be
 		 * controlled via relay_100 parameter */
 		Trans->uac[branch].last_received=new_code;
@@ -2297,9 +2288,6 @@ int reply_received( struct sip_msg  *p_msg )
 							run_trans_callbacks_off_params(TMCB_REQUEST_SENT,
 									t, &onsend_params);
 					}
-#ifndef WITH_AS_SUPPORT
-					shm_free(ack);
-#endif
 				}
 			}
 		}

+ 0 - 2
src/modules/tm/tm_load.c

@@ -111,10 +111,8 @@ int load_tm( struct tm_binds *tmb)
 	tmb->register_new_dlg_cb=register_new_dlg_cb;
 	tmb->register_dlg_tmcb=register_dlg_tmcb;
 #endif
-#ifdef WITH_AS_SUPPORT
 	tmb->ack_local_uac = ack_local_uac;
 	tmb->t_get_canceled_ident = t_get_canceled_ident;
-#endif
 	tmb->t_suspend = t_suspend;
 	tmb->t_continue = t_continue;
 	tmb->t_continue_cb = t_continue_cb;

+ 0 - 5
src/modules/tm/tm_load.h

@@ -92,13 +92,8 @@ struct tm_binds {
 	                    if no dlg callbacks are used/defined*/
 	void* reserved2;
 #endif
-#ifdef WITH_AS_SUPPORT
 	ack_local_uac_f           ack_local_uac;
 	t_get_canceled_ident_f    t_get_canceled_ident;
-#else
-	void* reserved3;
-	void* reserved4;
-#endif
 	t_suspend_f	t_suspend;
 	t_continue_f	t_continue;
 	t_continue_cb_f	t_continue_cb;

+ 0 - 4
src/modules/tm/uac.c

@@ -457,10 +457,8 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
 		new_cell->flags |= T_IS_INVITE_FLAG;
 		new_cell->flags|=T_AUTO_INV_100 &
 				(!cfg_get(tm, tm_cfg, tm_auto_inv_100) -1);
-#ifdef WITH_AS_SUPPORT
 		if (uac_r->cb_flags & TMCB_DONT_ACK)
 			new_cell->flags |= T_NO_AUTO_ACK;
-#endif
 		lifetime=cfg_get(tm, tm_cfg, tm_max_inv_lifetime);
 	}else
 		lifetime=cfg_get(tm, tm_cfg, tm_max_noninv_lifetime);
@@ -736,7 +734,6 @@ int t_uac_with_ids(uac_req_t *uac_r,
 	return ret;
 }
 
-#ifdef WITH_AS_SUPPORT
 struct retr_buf *local_ack_rb(sip_msg_t *rpl_2xx, struct cell *trans,
 					unsigned int branch, str *hdrs, str *body)
 {
@@ -868,7 +865,6 @@ fin:
 
 #undef RET_INVALID
 }
-#endif /* WITH_AS_SUPPORT */
 
 
 /*

+ 0 - 4
src/modules/tm/uac.h

@@ -80,9 +80,7 @@ typedef int (*req_t)(uac_req_t *uac_r, str* ruri, str* to, str* from, str *next_
 typedef int (*t_uac_t)(uac_req_t *uac_r);
 typedef int (*t_uac_with_ids_t)(uac_req_t *uac_r,
 		unsigned int *ret_index, unsigned int *ret_label);
-#ifdef WITH_AS_SUPPORT
 typedef int (*ack_local_uac_f)(struct cell *trans, str *hdrs, str *body);
-#endif
 typedef int (*prepare_request_within_f)(uac_req_t *uac_r,
 		struct retr_buf **dst_req);
 typedef void (*send_prepared_request_f)(struct retr_buf *request_dst);
@@ -123,7 +121,6 @@ int req_within(uac_req_t *uac_r);
 int req_outside(uac_req_t *uac_r, str* ruri, str* to, str* from, str* next_hop);
 
 
-#ifdef WITH_AS_SUPPORT
 struct retr_buf *local_ack_rb(sip_msg_t *rpl_2xx, struct cell *trans,
 					unsigned int branch, str *hdrs, str *body);
 void free_local_ack(struct retr_buf *lack);
@@ -133,7 +130,6 @@ void free_local_ack_unsafe(struct retr_buf *lack);
  * ACK an existing local INVITE transaction...
  */
 int ack_local_uac(struct cell *trans, str *hdrs, str *body);
-#endif
 
 /*
  * Send a transactional request, no dialogs involved