aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-01 00:52:00 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-01 00:52:00 +0000
commit70c17d62d495c582a266bbba2a6513734b1ef6d4 (patch)
tree1efd5196a7f03a0e92638f35dac2a4e094f2b8f2 /channels
parentcfe7eed33c5b833bc0d2f2b2b8d91cc57d5f4d54 (diff)
Minor changes inspired by testing with latest GCC.
The latest GCC (what will become 4.5.x) has a few new warnings, that in these cases found some either downright buggy code, or at least seriously poorly designed code that could be improved. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@209759 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/misdn/ie.c2
-rw-r--r--channels/misdn/isdn_lib.c15
2 files changed, 11 insertions, 6 deletions
diff --git a/channels/misdn/ie.c b/channels/misdn/ie.c
index 2e7fae998..1b9c799e4 100644
--- a/channels/misdn/ie.c
+++ b/channels/misdn/ie.c
@@ -242,7 +242,7 @@ static void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *c
if (p[0] <= octet)
goto done;
- if (!p[octet++] & 0x80)
+ if (~p[octet++] & 0x80)
goto l2;
/* Wheee. V.110 speed information */
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index aef8936d9..f675798be 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -1906,9 +1906,7 @@ handle_event_nt(void *dat, void *arg)
case CC_SETUP|INDICATION:
{
struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0, 1, 0);
- if (!bc)
- ERR_NO_CHANNEL:
- {
+ if (!bc) {
msg_t *dmsg;
cb_log(4, stack->port, "Patch from MEIDANIS:Sending RELEASE_COMPLETE %x (No free Chan for you..)\n", hh->dinfo);
dmsg = create_l3msg(CC_RELEASE_COMPLETE | REQUEST,MT_RELEASE_COMPLETE, hh->dinfo,sizeof(RELEASE_COMPLETE_t), 1);
@@ -2106,8 +2104,15 @@ handle_event_nt(void *dat, void *arg)
if (bc->channel<=0 || bc->channel==0xff)
bc->channel=0;
- if (find_free_chan_in_stack(stack,bc, bc->channel,0)<0)
- goto ERR_NO_CHANNEL;
+ if (find_free_chan_in_stack(stack,bc, bc->channel,0)<0) {
+ msg_t *dmsg;
+ cb_log(4, stack->port, "Patch from MEIDANIS:Sending RELEASE_COMPLETE %x (No free Chan for you..)\n", hh->dinfo);
+ dmsg = create_l3msg(CC_RELEASE_COMPLETE | REQUEST,MT_RELEASE_COMPLETE, hh->dinfo,sizeof(RELEASE_COMPLETE_t), 1);
+ pthread_mutex_lock(&stack->nstlock);
+ stack->nst.manager_l3(&stack->nst, dmsg);
+ free_msg(msg);
+ return 0;
+ }
break;
case EVENT_RELEASE:
case EVENT_RELEASE_COMPLETE: