[Asterisk-cvs]
libpri-matt pri_internal.h, 1.9, 1.10 prisched.c, 1.2,
1.3 q931.c, 1.10, 1.11
mattf at lists.digium.com
mattf at lists.digium.com
Thu Dec 30 09:29:14 CST 2004
Update of /usr/cvsroot/libpri-matt
In directory mongoose.digium.com:/tmp/cvs-serv26488
Modified Files:
pri_internal.h prisched.c q931.c
Log Message:
Changes so we don't have to extra memory management
Index: pri_internal.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_internal.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pri_internal.h 29 Dec 2004 19:26:49 -0000 1.9
+++ pri_internal.h 30 Dec 2004 14:23:55 -0000 1.10
@@ -145,7 +145,7 @@
int message; /* What message to send the ADPU in */
void (*callback)(void *data); /* Callback function for when response is received */
void *data; /* Data to callback */
- void *adpu; /* ADPU to send */
+ unsigned char adpu[255]; /* ADPU to send */
int adpu_len; /* Length of ADPU */
int sent; /* Have we been sent already? */
struct adpu_event *next; /* Linked list pointer */
Index: prisched.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/prisched.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- prisched.c 29 Dec 2004 18:09:45 -0000 1.2
+++ prisched.c 30 Dec 2004 14:23:55 -0000 1.3
@@ -124,7 +124,7 @@
struct adpu_event *cur = NULL;
struct adpu_event *new_event = NULL;
- if (!call || !messagetype || !adpu || (adpu_len < 1))
+ if (!call || !messagetype || !adpu || (adpu_len < 1) || (adpu_len > 255))
return -1;
new_event = malloc(sizeof(struct adpu_event));
@@ -134,7 +134,7 @@
new_event->message = messagetype;
new_event->callback = function;
new_event->data = data;
- new_event->adpu = adpu;
+ memcpy(new_event->adpu, adpu, adpu_len);
new_event->adpu_len = adpu_len;
} else {
pri_error("malloc failed\n");
Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/q931.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- q931.c 30 Dec 2004 14:17:17 -0000 1.10
+++ q931.c 30 Dec 2004 14:23:55 -0000 1.11
@@ -1427,10 +1427,11 @@
FUNC_SEND(transmit_facility)
{
struct adpu_event *tmp = call->adpus;
+ struct rose_component *comp = NULL;
int i = 0;
while (tmp) {
- if (tmp->message = msgtype)
+ if (tmp->message == msgtype)
break;
}
@@ -1451,7 +1452,7 @@
comp->len = tmp->adpu_len;
i += 2;
memcpy(comp->data, tmp->adpu, tmp->adpu_len);
- i += adpu_len;
+ i += tmp->adpu_len;
return i + 2;
}
More information about the svn-commits
mailing list