[Sofia-sip-devel] sofia-sip changes (2008-05-19)

2008-05-19 Thread Sofia-SIP Darcs Changes
This posting was generated automatically from darcs repo
.

Wed May  7 15:22:33 EEST 2008  [EMAIL PROTECTED]
  * remove assert

M ./libsofia-sip-ua/soa/soa_static.c -5

Wed May  7 15:21:45 EEST 2008  [EMAIL PROTECTED]
  * nua_handle_by_call_id

M ./libsofia-sip-ua/nta/nta.c +49
M ./libsofia-sip-ua/nta/sofia-sip/nta.h +4
M ./libsofia-sip-ua/nua/nua.c +50
M ./libsofia-sip-ua/nua/nua_stack.c +9
M ./libsofia-sip-ua/nua/nua_stack.h +3
M ./libsofia-sip-ua/nua/sofia-sip/nua.h +1

Mon May 19 18:55:49 EEST 2008  Pekka Pessi <[EMAIL PROTECTED]>
  * Doxyfile.aliases: added @VERSION_1_12_9 and @NEW_1_12_9

M ./libsofia-sip-ua/docs/Doxyfile.aliases +2

Mon May 19 18:55:28 EEST 2008  Pekka Pessi <[EMAIL PROTECTED]>
  * configure.ac: check for fnmatch.h

M ./configure.ac +2

Mon May 19 18:54:55 EEST 2008  Pekka Pessi <[EMAIL PROTECTED]>
  * open_c/group/test_nua.mmp: updated source path

M ./open_c/group/test_nua.mmp -1 +1

Mon May 19 18:54:35 EEST 2008  Pekka Pessi <[EMAIL PROTECTED]>
  * win32/libsofia-sip-ua: updated libsofia_sip_ua.dsp and 
libsofia_sip_ua.vcproj

M ./win32/libsofia-sip-ua/libsofia_sip_ua.dsp +4
M ./win32/libsofia-sip-ua/libsofia_sip_ua.vcproj +4

Mon May 19 18:54:03 EEST 2008  Pekka Pessi <[EMAIL PROTECTED]>
  * win32/tests/test_nua: updated test_nua.dsp and test_nua.vcproj

M ./win32/tests/test_nua/test_nua.dsp -22 +22
M ./win32/tests/test_nua/test_nua.vcproj -22 +22

Mon May 19 18:53:23 EEST 2008  Pekka Pessi <[EMAIL PROTECTED]>
  * tport_type_tcp.c: report EPIPE when transport gets closed after ping-pong 
timeout

M ./libsofia-sip-ua/tport/tport_tag.c -1 +1
M ./libsofia-sip-ua/tport/tport_type_tcp.c -2 +5

Mon May 19 18:31:45 EEST 2008  [EMAIL PROTECTED]
  * nua_stack.c: include Allow-Events in requests initiating dialog, too

  The Allow-Events header is now alwats included with NOTIFY requests, and
  initial INVITE, SUBSCRIBE, REFER, and OPTIONS requests.
  
  Thanks to Jerry Richards for pointing out the problem.

M ./libsofia-sip-ua/nua/nua_stack.c -2 +17

Fri May 16 12:06:09 EEST 2008  [EMAIL PROTECTED]
  * nua_register.c: nr->nr_tport was used even if nr was NULL
  
  Problem detected by Klocwork.

M ./libsofia-sip-ua/nua/nua_register.c -1 +4

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] su_pthread_port_clone_main does not finish before unloading the library

2008-05-19 Thread Pekka Pessi
2008/5/19 Martin Drasar <[EMAIL PROTECTED]>:
> Problem 1)
> When the stack should end, I run that ugly piece of code, that calls
> nua_sutdown(), does su_root_step() to receive the nua_r_shutdown event
> and then calls nua_destroy(). However, even if I receive the
> nua_r_shutdown event, nua_destroy() reports: FATAL: nua_shutdown not
> completed.

I think I've got this message when I've tried to call nua_shutdown()
twice or nua_destroy() on already destroyed nua.

> Problem 2)
> After calling the su_root_destroy() and su_deinit() the
> su_pthread_port_clone_main is still running and waiting inside su_wait()
> function. This leads to access violations whenever I try to unload sofia
> library before shutting down the program.
> su_root_destroy() documentation states that I should not call it from
> cloned task. Is this the case? And if not, why does it fails to stop the
> thread?

su_init()/su_deinit() is per-process initialization stuff.

You can use threads w/ Sofia in two alternative ways:

1/ You create thread by your self, and call su_root_create() by
yourself. Then call su_root_run()/su_root_step() to process su_root_t
stuff. When you want to exit from thread, you should call
su_root_break() (if su_root_run()ing) and then su_root_destroy().

2/ You call su_clone_start() and get su_clone_t reference. A new
thread is created. When you'd want to get rid of that thread, you call
su_clone_wait() from the main thread.

-- 
Pekka.Pessi mail at nokia.com

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] su_pthread_port_clone_main does not finish before unloading the library

2008-05-19 Thread Michael Jerris

On May 19, 2008, at 11:23 AM, Martin Drasar wrote:

> Hello everyone,
> I have two problems related to shutting down sofia stack.
>
> In my application I create a separate thread that does the stack
> initialization and runs the event loop. That's how I do it:
>
> su_init();
> su_root_create(instance->root);
> nua_create(instance->root, ...); <- this is where the
> su_pthread_port_clone_main is started
> nua_set_params();
> while (true)
> {
>  su_root_step (instance->root, 100);
>  if (terminate)
>  {
>event->reset();
>nua_shutdown(instance->nua);
>su_root_step(instance->root, 500);
>event->wait(500);
>nua_destroy(instance->nua);
>break;
>  }
> }
> su_root_destroy (instance->root);
> su_deinit();
>
> Problem 1)
> When the stack should end, I run that ugly piece of code, that calls
> nua_sutdown(), does su_root_step() to receive the nua_r_shutdown event
> and then calls nua_destroy(). However, even if I receive the
> nua_r_shutdown event, nua_destroy() reports: FATAL: nua_shutdown not
> completed.
> What is the clean way to handle this? And what else is needed for
> nua_shutdown() to be successfull?

You can/will get several status 101 r_shutdown events, you must wait  
for a status >=200.

>
>
> Problem 2)
> After calling the su_root_destroy() and su_deinit() the
> su_pthread_port_clone_main is still running and waiting inside  
> su_wait()
> function. This leads to access violations whenever I try to unload  
> sofia
> library before shutting down the program.
> su_root_destroy() documentation states that I should not call it from
> cloned task. Is this the case? And if not, why does it fails to stop  
> the
> thread?

See problem 1, I think this is related.

Mike

>
>
> Any help is much appreciated
> Thanks in advance
>
> Martin
>
> -- 
>  Martin Drasar, Developer / Analyst
>  OptimSys, s.r.o.
>  [EMAIL PROTECTED]
>  Tel: +420 541 143 065
>  Fax: +420 541 143 066
>  http://www.optimsys.cz
>
>
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> Sofia-sip-devel mailing list
> Sofia-sip-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] su_pthread_port_clone_main does not finish before unloading the library

2008-05-19 Thread Martin Drasar
Hello everyone,
I have two problems related to shutting down sofia stack.

In my application I create a separate thread that does the stack 
initialization and runs the event loop. That's how I do it:

su_init();
su_root_create(instance->root);
nua_create(instance->root, ...); <- this is where the 
su_pthread_port_clone_main is started
nua_set_params();
while (true)
{
  su_root_step (instance->root, 100);
  if (terminate)
  {
event->reset();
nua_shutdown(instance->nua);
su_root_step(instance->root, 500);
event->wait(500);
nua_destroy(instance->nua);
break;
  }
}
su_root_destroy (instance->root);
su_deinit();

Problem 1)
When the stack should end, I run that ugly piece of code, that calls 
nua_sutdown(), does su_root_step() to receive the nua_r_shutdown event 
and then calls nua_destroy(). However, even if I receive the 
nua_r_shutdown event, nua_destroy() reports: FATAL: nua_shutdown not 
completed.
What is the clean way to handle this? And what else is needed for 
nua_shutdown() to be successfull?

Problem 2)
After calling the su_root_destroy() and su_deinit() the 
su_pthread_port_clone_main is still running and waiting inside su_wait() 
function. This leads to access violations whenever I try to unload sofia 
library before shutting down the program.
su_root_destroy() documentation states that I should not call it from 
cloned task. Is this the case? And if not, why does it fails to stop the 
thread?

Any help is much appreciated
Thanks in advance

Martin

-- 
  Martin Drasar, Developer / Analyst
  OptimSys, s.r.o.
  [EMAIL PROTECTED]
  Tel: +420 541 143 065
  Fax: +420 541 143 066
  http://www.optimsys.cz


-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel