Per kpfleming add a note describing why you must never change the first element of peer_finding_info.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@166858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2008-12-29 14:52:22 +00:00
parent f2a3836106
commit 75d4f7e1c2

View File

@@ -4087,6 +4087,11 @@ static struct sip_peer *realtime_peer(const char *newpeername, struct sockaddr_i
return peer;
}
/* The first element here must *always* be tmp_peer. This is because the user of this function
* passes it in using OBJ_POINTER which causes astobj2 to perform hashing on the name to find
* where the peer is. Since tmp_peer is at the beginning this just magically works. Move it and it
* will break. People will be angry. Just don't do it.
*/
struct peer_finding_info {
struct sip_peer tmp_peer;
int forcenamematch;