[Sofia-sip-devel] sofia-sip changes (2006-12-08)

2006-12-08 Thread Sofia-SIP Darcs Changes
This posting was generated automatically from darcs repo
.

Fri Dec  8 14:02:06 EET 2006  [EMAIL PROTECTED]
  * sres.c: not using close() directly on sockets.
  
  Problem reported by Roman Filonenko.

M ./libsofia-sip-ua/sresolv/sres.c -3 +10

Thu Dec  7 19:26:42 EET 2006  [EMAIL PROTECTED]
  * msg_mclass.c: added checks for already inserted headers.
  
  - msg_mclass_insert_header()
  - msg_mclass_insert_with_mask()

M ./libsofia-sip-ua/msg/msg_mclass.c -2 +8

Fri Dec  8 10:05:32 EET 2006  [EMAIL PROTECTED]
  * nua_session.c: fixed possible segfault in signal_call_state_change()
  
  Thanks for Michael Jerris for reporting the problem.

M ./libsofia-sip-ua/nua/nua_session.c -1 +1

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] tport logging tags

2006-12-08 Thread Roman Filonenko
Pekka Pessi wrote:
> On 12/8/06, Roman Filonenko wrote:
>> For now, tport uses TPORT_LOG and TPORT_DUMP environment variables to
>> configure the log flags and we found that more dynamic configuration of
>> the above flags (e.g. on nua_create()) is much more comfortable.
>
> Thanks. I think that having environment variables to override the
> application configuration behavious is more flexible (so TPORT_LOG
> environment variable would override TPTAG_LOG() - you could debug a
> process simply by setting the environment variable). That is the way
> TPORT_DEBUG and su_log_soft_set_level() works. Perhaps a second tag,
> TPORT_LOG_OVERRIDE()?
>
> Any opinions? Application settings override environment, or vice versa?
The primary reason I had for application settings to override 
environment was simple -
to control the log settings on per nua_t basis.

With TPORT_LOG_OVERRIDE() tag one won't be able to quickly get all the 
logs just
setting the env. variable. Maybe adding TPORT_LOG_OVERRIDE environment 
variable
(but not tag) will help - defaults may be provided with TPORT_LOG 
environment variable,
application may override it on a per nua_t basis with TPORT_LOG() tag 
and, if needed
for debugging, TPORT_LOG_OVERRIDE environment variable will override all 
the previous
settings.

>
> Another thing: an nta application could use several primary transports
> with different settings, stored in tport_params_t. Now if we set the
> logging with tags, it would probably be much nicer to store the log
> bit in in tport_params_t instead of mr_log. The mr_dump_file is a bit
> trickier.
>
Agree.

Best regards,
Roman

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


Re: [Sofia-sip-devel] tport logging tags

2006-12-08 Thread Pekka Pessi
On 12/8/06, Roman Filonenko <[EMAIL PROTECTED]> wrote:
> For now, tport uses TPORT_LOG and TPORT_DUMP environment variables to
> configure the log flags and we found that more dynamic configuration of
> the above flags (e.g. on nua_create()) is much more comfortable.

Thanks. I think that having environment variables to override the
application configuration behavious is more flexible (so TPORT_LOG
environment variable would override TPTAG_LOG() - you could debug a
process simply by setting the environment variable). That is the way
TPORT_DEBUG and su_log_soft_set_level() works. Perhaps a second tag,
TPORT_LOG_OVERRIDE()?

Any opinions? Application settings override environment, or vice versa?

Another thing: an nta application could use several primary transports
with different settings, stored in tport_params_t. Now if we set the
logging with tags, it would probably be much nicer to store the log
bit in in tport_params_t instead of mr_log. The mr_dump_file is a bit
trickier.

-- 
Pekka.Pessi mail at nokia.com

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] tport logging tags

2006-12-08 Thread Roman Filonenko
Pekka,

For now, tport uses TPORT_LOG and TPORT_DUMP environment variables to 
configure the log flags and we found that more dynamic configuration of 
the above flags (e.g. on nua_create()) is much more comfortable.

Please find below a whatsnew patch which adds TPTAG_LOG() and TPTAG_DUMP() 
tags, which take precedence over env. variables (if set).


{
hunk ./libsofia-sip-ua/nua/nua.c 106
+ * TPTAG_LOG()  \n
+ * TPTAG_DUMP() \n
hunk ./libsofia-sip-ua/tport/sofia-sip/tport_tag.h 267
+
+TPORT_DLL extern tag_typedef_t tptag_log;
+/** If set, print out all parsed SIP messages on transport layer. */
+#define TPTAG_LOG(x) tptag_log, tag_bool_v((x))
+
+TPORT_DLL extern tag_typedef_t tptag_log_ref;
+#define TPTAG_LOG_REF(x) tptag_log_ref, tag_bool_vr(&(x))
+
+TPORT_DLL extern tag_typedef_t tptag_dump;
+/** Filename for dumping unparsed messages from transport. */
+#define TPTAG_DUMP(x) tptag_dump, tag_str_v((x))
+
+TPORT_DLL extern tag_typedef_t tptag_dump_ref;
+#define TPTAG_DUMP_REF(x) tptag_dump_ref, tag_str_vr(&(x))
hunk ./libsofia-sip-ua/tport/tport_logging.c 93
-  char const *log;
+  char const *log = NULL;
+  int log_msg = getenv("MSG_STREAM_LOG") != NULL ||
+   getenv("TPORT_LOG") != NULL
+   ? 1 : 0;
hunk ./libsofia-sip-ua/tport/tport_logging.c 98
-  mr->mr_log = $
-getenv("MSG_STREAM_LOG") != NULL ||
-getenv("TPORT_LOG") != NULL $
-? MSG_DO_EXTRACT_COPY : 0;
-$
-  if ((log = getenv("TPORT_DUMP")) || (log = getenv("MSG_DUMP"))) {
+  tl_gets(tags, TPTAG_LOG_REF(log_msg), TAG_END());
+
+  mr->mr_log = log_msg ? MSG_DO_EXTRACT_COPY : 0;
+
+  tl_gets(tags, TPTAG_DUMP_REF(log), TAG_END());
+  if ((log) || (log = getenv("TPORT_DUMP")) || (log = 
getenv("MSG_DUMP"))) {
hunk ./libsofia-sip-ua/tport/tport_tag.c 81
+tag_typedef_t tptag_log = INTTAG_TYPEDEF(log);
+tag_typedef_t tptag_dump = STRTAG_TYPEDEF(dump);
}

I've sent you a complete darcs patch with a separate email.

Best regards,
Roman

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel


[Sofia-sip-devel] sres.c calls close() instead of su_close()

2006-12-08 Thread Roman Filonenko

Pekka,

sres.c uses close() to close sockets now, while closesocket() should be 
used for win32. As sres.c uses su anyway, the below whatsnew patch 
replaces calls to close() with calls to su_close().


I suppose that the rest of socket functions called in sres.c should be 
replaced with su_ - I plan to prepare a patch for it on the next week.


{
hunk ./libsofia-sip-ua/sresolv/sres.c 80
+#include 
hunk ./libsofia-sip-ua/sresolv/sres.c 152
-#define SOCKET_ERROR   (-1)
-#define INVALID_SOCKET ((sres_socket_t)-1)
hunk ./libsofia-sip-ua/sresolv/sres.c 2435
-  close(servers[i]->dns_socket);
+  su_close(servers[i]->dns_socket);
hunk ./libsofia-sip-ua/sresolv/sres.c 2511
-close(s);
+su_close(s);
hunk ./libsofia-sip-ua/sresolv/sres.c 2520
-  close(s);
+  su_close(s);
}

I've sent you a complete darcs patch with a separate email.

Best regards,
Roman
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel