[libpri-commits] mattf: branch 1.4 r1445 - /branches/1.4/q921.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Jan 29 11:27:48 CST 2010


Author: mattf
Date: Fri Jan 29 11:27:43 2010
New Revision: 1445

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1445
Log:
Fix bug in which an event was lost if an I-frame was received during a timer recovery state (related to #16713)

Modified:
    branches/1.4/q921.c

Modified: branches/1.4/q921.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q921.c?view=diff&rev=1445&r1=1444&r2=1445
==============================================================================
--- branches/1.4/q921.c (original)
+++ branches/1.4/q921.c Fri Jan 29 11:27:43 2010
@@ -56,10 +56,7 @@
 	(hf).h.tei = (pri)->tei; \
 } while(0)
 
-//static void reschedule_t203(struct pri *pri);
 static void reschedule_t200(struct pri *pri);
-//static void q921_restart(struct pri *pri, int now);
-//static void q921_tei_release_and_reacquire(struct pri *master);
 static void q921_dump_pri(struct pri *pri);
 static void q921_establish_data_link(struct pri *pri);
 static void q921_mdl_error(struct pri *pri, char error);
@@ -1633,6 +1630,14 @@
 			//res = q931_receive(PRI_MASTER(pri), pri->tei, (q931_h *)h->i.data, len - 4);
 			res = q931_receive(pri, pri->tei, (q931_h *)h->i.data, len - 4);
 
+			if (res == -1) {
+				eres = NULL;
+			}
+
+			if (res & Q931_RES_HAVEEVENT) {
+				eres = &pri->ev;
+			}
+
 			if (h->i.p_f) {
 				q921_rr(pri, 1, 0);
 				pri->acknowledge_pending = 0;
@@ -1662,7 +1667,6 @@
 		} else {
 			if (pri->q921_state == Q921_TIMER_RECOVERY) {
 				update_v_a(pri, h->i.n_r);
-				break;
 			} else {
 				if (pri->peer_rx_busy) {
 					update_v_a(pri, h->i.n_r);
@@ -1682,15 +1686,7 @@
 			}
 		}
 
-		if (res == -1) {
-			return NULL;
-		}
-
-		if (res & Q931_RES_HAVEEVENT) {
-			return &pri->ev;
-		} else {
-			return NULL;
-		}
+		break;
 	default:
 		pri_error(pri, "Don't know what to do with an I frame in state %d\n", pri->q921_state);
 		break;




More information about the libpri-commits mailing list