OpenSIPS/opensips — pull request #130 by dsandras (2013-11-15 14:25:28+00:00)
Title: Fixes bug where the pua db elements were deleted too early.

The problem is that the update_db function was deleting elements
10 seconds before they are expired and before the expire time could
have been extended by the same function.

This patch fixes the order of update and delete operations:
1) Update the expired elements (and other changes)
2) Delete expired elements after the possible update

This allows only deleting elements that are really expired.