summaryrefslogtreecommitdiff
path: root/code/test
diff options
context:
space:
mode:
Diffstat (limited to 'code/test')
-rw-r--r--code/test/basic.c8
-rw-r--r--code/test/client.c4
-rw-r--r--code/test/echo.c2
-rw-r--r--code/test/server.c4
-rw-r--r--code/test/stress.c6
-rw-r--r--code/test/vc_client.c4
-rw-r--r--code/test/vc_server.c4
-rw-r--r--code/test/voip.c2
8 files changed, 17 insertions, 17 deletions
diff --git a/code/test/basic.c b/code/test/basic.c
index 809d453..dae2819 100644
--- a/code/test/basic.c
+++ b/code/test/basic.c
@@ -29,8 +29,8 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign
return s;
}
- unsigned char payload[ECP_SIZE_PLD(1000)];
- unsigned char *buf = ecp_pld_get_buf(payload);
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
+ unsigned char *buf = ecp_pld_get_buf(payload, 0);
char *msg = "PERA JE CAR!";
ecp_pld_set_type(payload, MTYPE_MSG);
@@ -47,8 +47,8 @@ ssize_t handle_msg_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigne
ssize_t handle_msg_s(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
printf("MSG S:%s size:%ld\n", p, s);
- unsigned char payload[ECP_SIZE_PLD(1000)];
- unsigned char *buf = ecp_pld_get_buf(payload);
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
+ unsigned char *buf = ecp_pld_get_buf(payload, 0);
char *msg = "VAISTINU JE CAR!";
ecp_pld_set_type(payload, MTYPE_MSG);
diff --git a/code/test/client.c b/code/test/client.c
index 1d5dc6c..992479b 100644
--- a/code/test/client.c
+++ b/code/test/client.c
@@ -25,8 +25,8 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign
return s;
}
- unsigned char payload[ECP_SIZE_PLD(1000)];
- unsigned char *buf = ecp_pld_get_buf(payload);
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
+ unsigned char *buf = ecp_pld_get_buf(payload, 0);
char *msg = "PERA JE CAR!";
ecp_pld_set_type(payload, MTYPE_MSG);
diff --git a/code/test/echo.c b/code/test/echo.c
index fe17901..593b904 100644
--- a/code/test/echo.c
+++ b/code/test/echo.c
@@ -15,7 +15,7 @@ ECPConnHandler handler_s;
#define MTYPE_MSG 8
ssize_t handle_msg_s(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
- ssize_t rv = ecp_send(conn, p-ECP_SIZE_MSG_HDR, ECP_SIZE_MSG_HDR+s);
+ ssize_t rv = ecp_send(conn, p-ECP_SIZE_PLD_HDR-1, ECP_SIZE_PLD_HDR+1+s);
return s;
}
diff --git a/code/test/server.c b/code/test/server.c
index 6851cdf..471164e 100644
--- a/code/test/server.c
+++ b/code/test/server.c
@@ -17,8 +17,8 @@ ECPConnHandler handler_s;
ssize_t handle_msg_s(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
printf("MSG S:%s size:%ld\n", p, s);
- unsigned char payload[ECP_SIZE_PLD(1000)];
- unsigned char *buf = ecp_pld_get_buf(payload);
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
+ unsigned char *buf = ecp_pld_get_buf(payload, 0);
char *msg = "VAISTINU JE CAR!";
ecp_pld_set_type(payload, MTYPE_MSG);
diff --git a/code/test/stress.c b/code/test/stress.c
index 081c0cb..d1ead1d 100644
--- a/code/test/stress.c
+++ b/code/test/stress.c
@@ -77,7 +77,7 @@ static void catchINFO(int sig) {
void *sender(ECPConnection *c) {
int idx = (int)(c->conn_data);
- unsigned char payload[ECP_SIZE_PLD(1000)];
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
printf("OPEN:%d\n", idx);
while(1) {
@@ -112,7 +112,7 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign
ssize_t handle_msg_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
int idx = (int)(conn->conn_data);
- unsigned char payload[ECP_SIZE_PLD(1000)];
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
if (c_start) {
pthread_mutex_lock(&t_mtx[idx]);
@@ -126,7 +126,7 @@ ssize_t handle_msg_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigne
}
ssize_t handle_msg_s(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
- unsigned char payload[ECP_SIZE_PLD(1000)];
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
ecp_pld_set_type(payload, MTYPE_MSG);
ssize_t _rv = ecp_send(conn, payload, sizeof(payload));
return s;
diff --git a/code/test/vc_client.c b/code/test/vc_client.c
index 8f4b084..d5cb8f2 100644
--- a/code/test/vc_client.c
+++ b/code/test/vc_client.c
@@ -31,8 +31,8 @@ ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned
printf("OPEN!\n");
- unsigned char payload[ECP_SIZE_PLD(1000)];
- unsigned char *buf = ecp_pld_get_buf(payload);
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
+ unsigned char *buf = ecp_pld_get_buf(payload, 0);
char *msg = "PERA JE CAR!";
ecp_pld_set_type(payload, MTYPE_MSG);
diff --git a/code/test/vc_server.c b/code/test/vc_server.c
index fb6b923..47c6267 100644
--- a/code/test/vc_server.c
+++ b/code/test/vc_server.c
@@ -26,8 +26,8 @@ ssize_t handle_open(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned
ssize_t handle_msg(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
printf("MSG S:%s size:%ld\n", p, s);
- unsigned char payload[ECP_SIZE_PLD(1000)];
- unsigned char *buf = ecp_pld_get_buf(payload);
+ unsigned char payload[ECP_SIZE_PLD(1000, 0)];
+ unsigned char *buf = ecp_pld_get_buf(payload, 0);
char *msg = "VAISTINU JE CAR!";
ecp_pld_set_type(payload, MTYPE_MSG);
diff --git a/code/test/voip.c b/code/test/voip.c
index 8c53d01..db1ea9f 100644
--- a/code/test/voip.c
+++ b/code/test/voip.c
@@ -188,7 +188,7 @@ int main(int argc, char *argv[]) {
while(1) {
ecp_pld_set_type(payload, MTYPE_MSG);
- opus_buf = ecp_pld_get_buf(payload);
+ opus_buf = ecp_pld_get_buf(payload, 0);
opus_int32 len = a_read(handle_cpt, alsa_in_buf, alsa_frames, opus_enc, opus_buf, ECP_MAX_MSG);
if (len < 0) continue;
ssize_t _rv = ecp_send(&conn, payload, len);