Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#109 new callback genarated after UpnpUnRegisterClient()

open
upnp (66)
5
2012-12-14
2012-05-08
Yoichi NAKAYAMA
No

Description of UpnpUnRegisterClient() says
"The UPnP Library generates no more callbacks after this function returns".
But send_search_result() in ssdp_ctrlpt.c may generate one via function pointer determined at TPJobInit call.

Discussion

  • I found that callback is invoked AFTER HandleUnlock() in GenaAutoRenewSubscription(), gena_process_notification_event().
    I think there are possibilities to invoke callback after UpnpUnRegisterClient(), too:

    1. Thread-A stores callback pointer to local variable
    2. Thread-A releases lock
    3. Thread-B call UpnpUnRegisterClient() and it returns
    4. Thread-A invoke callback via local variable

    Invoke callback inside locked region will avoid the possibility, but I'm worry about that it may cause deadlocks depending on user supplied callback function.

    Any suggestions?

     
  • Hi Yiochi,

    Maybe calling the callback with HandleReadLock(), instead of HandleLock(), which is equivalent to HandleWriteLock()?