On Feb 02, 2010 at 14:38, Daniel-Constantin Mierla <miconda(a)gmail.com> wrote:
Hello,
some months ago (iirc) we had a discussion about the sip_msg structure
and the fact that it has too many header hooks, some for pretty uncommon
or not really used inside sip router code.
I spotted
- subject
- accept_language
- content_disposition
- accept_disposition
- unsupported
- organization
- diversion (expired draft?)
The list can continue a bit ... I was thinking to replace them with a
call of get_hdr_by_name|type() kind of function. The benefit will be
lower structure.
On the other hand, I would add a new field to hold the pid of the
process that received the message. There are some potential races by
using only id to identify a message, especially in serial forking.
Opinions?
I fully agree. I've tried doing this before for ser, but hit very strong
opposition.
Regarding the pid, I was thinking on extending the msg->id field and
include the pid or process_no there.
E.g.:
struct msgid_str{
int msg_no; /* per process */
unsigned short reserved; /* future use (e.g. extending msg_no to 48
bits */
unsigned short proc_no; /* process number, 64k should be enough */
};
union msg_id{
struct msgid_str raw;
unsigned long long id;
}
typedef uninon msg_id msg_id_t;
Andrei