瀏覽代碼

modules/tm: code cleanup removed unused method faked_resp and free_faked_resp

Richard Good 12 年之前
父節點
當前提交
a3db949272
共有 2 個文件被更改,包括 0 次插入56 次删除
  1. 0 53
      modules/tm/t_reply.c
  2. 0 3
      modules/tm/t_reply.h

+ 0 - 53
modules/tm/t_reply.c

@@ -806,59 +806,6 @@ static int _reply( struct cell *trans, struct sip_msg* p_msg,
 	}
 	}
 }
 }
 
 
-int fake_resp(struct sip_msg *faked_resp,
-		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac)
-{
-	/* on_failure_reply faked msg now copied from shmem msg (as opposed
-	* to zero-ing) -- more "read-only" actions (exec in particular) will
-	* work from reply_route as they will see msg->from, etc.; caution,
-	* rw actions may append some pkg stuff to msg, which will possibly be
-	* never released (shmem is released in a single block) */
-	memcpy( faked_resp, shmem_msg, sizeof(struct sip_msg));
-
-	/* if we set msg_id to something different from current's message
-	* id, the first t_fork will properly clean new branch URIs */
-	faked_resp->id=shmem_msg->id-1;
-	/* msg->parsed_uri_ok must be reset since msg_parsed_uri is
-	* not cloned (and cannot be cloned) */
-	faked_resp->parsed_uri_ok = 0;
-
-	faked_resp->msg_flags|=extra_flags; /* set the extra tm flags */
-
-	if(uac) setbflagsval(0, uac->branch_flags);
-	else setbflagsval(0, 0);
-
-	return 1;
-}
-
-void free_faked_resp(struct sip_msg *faked_resp, struct cell *t, int branch)
-{
-	struct hdr_field *hdr;
-
-	/* free all types of lump that were added */
-	del_nonshm_lump( &(faked_resp->add_rm) );
-	del_nonshm_lump( &(faked_resp->body_lumps) );
-	del_nonshm_lump_rpl( &(faked_resp->reply_lump) );
-
-	/* free header's parsed structures that were added */
-	for( hdr=faked_resp->headers ; hdr ; hdr=hdr->next ) {
-		if ( hdr->parsed && hdr_allocs_parse(hdr) &&
-			(hdr->parsed<(void*)t->uac[branch].reply)) {
-			DBG("DBG:free_faked_resp: removing hdr->parsed %d\n",
-				hdr->type);
- 
-			clean_hdr_field(hdr);
-			hdr->parsed = 0;
-		}
-	}
-	/* free parsed body added by failure handlers */
-	if (faked_resp->body) {
-		if(faked_resp->body->free)
-			faked_resp->body->free(&faked_resp->body);
-			faked_resp->body = 0;
-	}
-}
-
 /** create or restore a "fake environment" for running a failure_route, 
 /** create or restore a "fake environment" for running a failure_route, 
  * OR an "async environment" depending on is_async_value (0=std failure-faked, 1=async)
  * OR an "async environment" depending on is_async_value (0=std failure-faked, 1=async)
  * if msg is set -> it will fake the env. vars conforming with the msg; if NULL
  * if msg is set -> it will fake the env. vars conforming with the msg; if NULL

+ 0 - 3
modules/tm/t_reply.h

@@ -238,11 +238,8 @@ void rpc_reply(rpc_t* rpc, void* c);
 void faked_env( struct cell *t,struct sip_msg *msg, int is_async_env);
 void faked_env( struct cell *t,struct sip_msg *msg, int is_async_env);
 int fake_req(struct sip_msg *faked_req,
 int fake_req(struct sip_msg *faked_req,
 		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
 		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
-int fake_resp(struct sip_msg *faked_req,
-		struct sip_msg *shmem_msg, int extra_flags, struct ua_client *uac);
 
 
 void free_faked_req(struct sip_msg *faked_req, struct cell *t);
 void free_faked_req(struct sip_msg *faked_req, struct cell *t);
-void free_faked_resp(struct sip_msg *faked_req, struct cell *t, int branch);
 
 
 typedef int (*tget_picked_f)(void);
 typedef int (*tget_picked_f)(void);
 int t_get_picked_branch(void);
 int t_get_picked_branch(void);