|
From: <jpg...@us...> - 2007-12-19 15:55:17
|
Revision: 1317
http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1317&view=rev
Author: jpgrayson
Date: 2007-12-19 07:55:20 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Apply patch from Lee Howard to be able to disable debugging when it is compiled in.
I also touched up the whitespace for these touches.
Modified Paths:
--------------
trunk/lib/libiax2/src/iax.c
Modified: trunk/lib/libiax2/src/iax.c
===================================================================
--- trunk/lib/libiax2/src/iax.c 2007-12-19 15:42:24 UTC (rev 1316)
+++ trunk/lib/libiax2/src/iax.c 2007-12-19 15:55:20 UTC (rev 1317)
@@ -826,17 +826,21 @@
{
int res;
#ifdef DEBUG_SUPPORT
- struct ast_iax2_full_hdr *h = (struct ast_iax2_full_hdr *)(f->data);
+ if (debug) {
+ struct ast_iax2_full_hdr *h = (struct ast_iax2_full_hdr *)f->data;
- if (ntohs(h->scallno) & IAX_FLAG_FULL)
- iax_showframe(f, NULL, 0, f->transfer ?
- &(f->session->transfer) :
- &(f->session->peeraddr),
- f->datalen - sizeof(struct ast_iax2_full_hdr));
+ if (ntohs(h->scallno) & IAX_FLAG_FULL)
+ iax_showframe(f, NULL, 0, f->transfer ?
+ &(f->session->transfer) :
+ &(f->session->peeraddr),
+ f->datalen -
+ sizeof(struct ast_iax2_full_hdr));
+ }
#endif
/* Send the frame raw */
- res = f->session->sendto(netfd, (const char *) f->data, f->datalen, IAX_SOCKOPTS,
- f->transfer ? (struct sockaddr *)&(f->session->transfer) :
+ res = f->session->sendto(netfd, (const char *) f->data, f->datalen,
+ IAX_SOCKOPTS, f->transfer ?
+ (struct sockaddr *)&(f->session->transfer) :
(struct sockaddr *)&(f->session->peeraddr),
sizeof(f->session->peeraddr));
return res;
@@ -2507,7 +2511,8 @@
}
#ifdef DEBUG_SUPPORT
- iax_showframe(NULL, fh, 1, sin, datalen);
+ if (debug)
+ iax_showframe(NULL, fh, 1, sin, datalen);
#endif
/* Get things going with it, timestamp wise, if we
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|