| 1213 | } |
| 1214 | |
| 1215 | static int store_reply( struct cell *trans, int branch, struct sip_msg *rpl) |
| 1216 | { |
| 1217 | # ifdef EXTRA_DEBUG |
| 1218 | if (TM_BRANCH(trans, branch).reply) { |
| 1219 | LM_ERR("replacing stored reply; aborting\n"); |
| 1220 | abort(); |
| 1221 | } |
| 1222 | # endif |
| 1223 | |
| 1224 | /* when we later do things such as challenge aggregation, |
| 1225 | we should parse the message here before we conserve |
| 1226 | it in shared memory; -jiri |
| 1227 | */ |
| 1228 | if (rpl==FAKED_REPLY) |
| 1229 | TM_BRANCH(trans,branch).reply=FAKED_REPLY; |
| 1230 | else |
| 1231 | TM_BRANCH(trans,branch).reply = sip_msg_cloner( rpl, 0, 0 ); |
| 1232 | |
| 1233 | if (! TM_BRANCH(trans,branch).reply ) { |
| 1234 | LM_ERR("failed to alloc' clone memory\n"); |
| 1235 | return 0; |
| 1236 | } |
| 1237 | |
| 1238 | return 1; |
| 1239 | } |
| 1240 | |
| 1241 | /* this is the code which decides what and when shall be relayed |
| 1242 | upstream; note well -- it assumes it is entered locked with |
no test coverage detected