Commit 39a4940b authored by Tommy Olofsson's avatar Tommy Olofsson
Browse files

LabComm failing silently?

parent a7e426fb
......@@ -204,13 +204,17 @@ void protocol_data_received(struct firefly_connection *conn,
unsigned char *data, size_t size)
{
if (conn->open == FIREFLY_CONNECTION_OPEN) {
printf("Setting dec buf\n");
labcomm_decoder_ioctl(conn->transport_decoder,
FIREFLY_LABCOMM_IOCTL_READER_SET_BUFFER,
data, size);
int res = 0;
while (res >= 0)
while (res >= 0) {
printf("decoding one\n");
res = labcomm_decoder_decode_one(conn->transport_decoder);
}
}
} else
printf("FAIL IN %s\n", __func__);
}
void handle_channel_request(firefly_protocol_channel_request *chan_req,
......@@ -222,6 +226,7 @@ void handle_channel_request(firefly_protocol_channel_request *chan_req,
conn = context;
printf("%s\n", __func__);
fecrr = FIREFLY_MALLOC(sizeof(*fecrr));
if (fecrr == NULL) {
firefly_error(FIREFLY_ERROR_ALLOC, 1,
......@@ -381,6 +386,7 @@ void handle_channel_ack(firefly_protocol_channel_ack *chan_ack, void *context)
struct firefly_event_chan_ack_recv *fecar;
int ret;
printf("%s\n", __func__);
conn = context;
fecar = FIREFLY_MALLOC(sizeof(*fecar));
if (fecar == NULL) {
......@@ -427,6 +433,7 @@ void handle_channel_close(firefly_protocol_channel_close *chan_close,
struct firefly_connection *conn;
struct firefly_channel *chan;
printf("%s\n", __func__);
conn = context;
chan = find_channel_by_local_id(conn, chan_close->dest_chan_id);
if (chan != NULL){
......@@ -529,6 +536,7 @@ void handle_ack(firefly_protocol_ack *ack, void *context)
struct firefly_connection *conn;
struct firefly_channel *chan;
printf("%s\n", __func__);
conn = context;
chan = find_channel_by_local_id(conn, ack->dest_chan_id);
if (chan == NULL) {
......@@ -617,6 +625,7 @@ void handle_channel_restrict_request(
struct firefly_event_channel_restrict_request *earg;
int ret;
printf("%s\n", __func__);
conn = context;
earg = FIREFLY_MALLOC(sizeof(*earg));
if (!earg) {
......@@ -697,6 +706,7 @@ void handle_channel_restrict_ack(firefly_protocol_channel_restrict_ack *data,
conn = context;
printf("%s\n", __func__);
earg = FIREFLY_MALLOC(sizeof(*earg));
if (!earg) {
firefly_error(FIREFLY_ERROR_ALLOC, 1,
......
......@@ -396,6 +396,7 @@ static int firefly_transport_udp_posix_read_event(void *event_arg)
struct transport_llp_udp_posix *llp_udp;
struct firefly_connection *conn;
printf("%s\n", __func__);
ev_arg = event_arg;
llp_udp = ev_arg->llp->llp_platspec;
......@@ -476,8 +477,10 @@ void firefly_transport_udp_posix_read(struct firefly_transport_llp *llp)
}
len = sizeof(remote_addr);
/* printf("recv %d byte\n", pkg_len); */
printf("receiving\n");
res = recvfrom(llp_udp->local_udp_socket, (void *) ev_arg->data, pkg_len, 0,
(struct sockaddr *) &remote_addr, (void *) &len);
printf("received\n");
/* printf("recv'd %d byte\n", res); */
if (res == -1) {
char err_buf[ERROR_STR_MAX_LEN];
......
......@@ -161,6 +161,7 @@ void firefly_resend_remove(struct resend_queue *rq, unsigned char id)
{
struct resend_elem *re;
printf("%s\n", __func__);
semTake(rq->lock, WAIT_FOREVER);
re = firefly_resend_pop(rq, id);
if (re != NULL)
......@@ -237,7 +238,7 @@ int firefly_resend_wait(struct resend_queue *rq,
} else {
*data = malloc(res->size);
if (!*data)
printf("malloc failed %s:%s\n", __FILE__, __LINE__);
printf("malloc failed %s:%d\n", __FILE__, __LINE__);
memcpy(*data, res->data, res->size);
*size = res->size;
*id = res->id;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment