Use shared_ptr for automatic reference counting of sockets, instead of
doing it manually through atomic_ref_cnt.
Use shared_ptr instead of raw pointers in all appropriate places.
Add const qualifier for a few methods.
No functional change.
Change-Id: I7db07fd90a2398f0253290aa2d810f8599e3983e
On shutdown, call shutdown() in the socket, so that a thread blocked in
recv() wakes up and gets a chance to exit cleanly.
Change-Id: I24b1b7c608ec1307019b424becef31e8db02e7bb
Zero is a valid file descriptor. Anything that's not -1 can in fact be a
valid file descriptor.
Make sure `sd` is set to -1 whenever no socket is open.
Add dtor to socket class to close the socket if it's open.
Add a few related formatting fixes as well.
Change-Id: Id9d3ad74b986c82ac6ab698a1e8f1f38e0f92414
Initialize `from_addr` just setting it all to zero.
Fixes:
*** CID 545189: Uninitialized members (UNINIT_CTOR)
/core/sip/udp_trsp.cpp: 265 in udp_trsp::udp_trsp(udp_trsp_socket *)()
259 msg.msg_name = &from_addr;
260 msg.msg_namelen = sizeof(sockaddr_storage);
261 msg.msg_iov = iov;
262 msg.msg_iovlen = 1;
263 msg.msg_control = dst_addr_buf;
264 msg.msg_controllen = DSTADDR_DATASIZE;
>>> CID 545189: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "from_addr.__ss_align" is not initialized in this constructor nor in any functions that it calls.
265 }
266
267 udp_trsp::~udp_trsp()
268 {
269 }
270
Change-Id: I7f960e6b41c6d7dfec4f70a91d0e7b37f7675127
Turn objects used by recvmsg() into class members. Eliminates having to
re-initialise them each time.
Change-Id: I9acb6f5f6460c5a9f4c7fb41f8a9e517c7cbbf8b
Warned-by: Coverity
SIP message processing and Session event processing are now
enclosed in blocks with the form
vv <type> [<callid>|<ltag>] ... vv
^^ <type> [<callid>|<ltag>] ... ^^
where
<type> = M SIP message processing
<type> = S Session event processing
this can give the server some room for processing SIP messages in load spikes.
Obviously that can not help against constant overload though...
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1786 8eb893ce-cfd4-0310-b710-fb5ebe64c474
- static library sip_stack.a (with dependencies on the core).
- removed AmServer and moved SipCtrlInterface into the core directory.
- TODO:
- CMake support to make core/sip/sip_stack.a and link against it in the core.
- merge AmSipRequest/AmSipReply and sip_msg structures.
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1758 8eb893ce-cfd4-0310-b710-fb5ebe64c474