TM :: Message cloning functionality. More...
#include "defs.h"#include "sip_msg.h"#include "../../dprint.h"#include "../../mem/mem.h"#include "../../data_lump.h"#include "../../data_lump_rpl.h"#include "../../ut.h"#include "../../sip_msg_clone.h"#include "../../fix_lumps.h"
Go to the source code of this file.
Cloning a message into shared memory (TM keeps a snapshot of messages in memory); note that many operations, which allocate pkg memory (such as parsing) cannot be used with a cloned message -- it would result in linking pkg structures to shmem msg and eventually in a memory error.
The cloned message is stored in a single memory fragment to save too many shm_mallocs -- these are expensive as they not only take lookup in fragment table but also a shmem lock operation (the same for shm_free)
Allow postponing the cloning of SIP msg: t_newtran() copies the requests to shm mem without the lumps, and t_forward_nonack() clones the lumps later when it is called the first time.
Definition in file tm/sip_msg.c.
| shm_msg | SIP message in shared memory | |
| pkg_msg | SIP message in private memory |
Definition at line 110 of file tm/sip_msg.c.
References sip_msg::add_rm, sip_msg::body_lumps, sip_msg::first_line, FL_SHM_CLONE, lumps_are_cloned, METHOD_ACK, sip_msg::msg_flags, msg_lump_cloner(), and sip_msg::reply_lump.

| org_msg | Original SIP message | |
| sip_msg_len | Length of the SIP message |
Definition at line 86 of file tm/sip_msg.c.
References sip_msg::first_line, and sip_msg_shm_clone().

1.7.1