|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
/*
|
|
|
|
|
* Secure X Message Passing Library v2 examples.
|
|
|
|
|
*
|
|
|
|
|
* (c) Originally written by somebody else ...
|
|
|
|
|
* (c) Alexander Vdolainen 2013-2015 <avdolainen@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* libsxmp is free software: you can redistribute it and/or modify it
|
|
|
|
@ -240,6 +241,9 @@ static int __dir_read(void *m, sexp_t *sx)
|
|
|
|
|
char *buf;
|
|
|
|
|
size_t ln = 0;
|
|
|
|
|
int stid = -1;
|
|
|
|
|
datastream_t *item;
|
|
|
|
|
usrtc_node_t *node;
|
|
|
|
|
char dump[2048];
|
|
|
|
|
|
|
|
|
|
if (sexp_list_cdr(sx, &lsx) || !sx->list->next || !sx->list->next->val
|
|
|
|
|
|| (0 >= (stid = atoi(sx->list->next->val) )) )
|
|
|
|
@ -249,8 +253,6 @@ static int __dir_read(void *m, sexp_t *sx)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* get stream item */
|
|
|
|
|
datastream_t *item;
|
|
|
|
|
usrtc_node_t *node;
|
|
|
|
|
pthread_rwlock_rdlock(&_lock);
|
|
|
|
|
if ( !(node = usrtc_lookup(_rd_streams, &stid)) ) {
|
|
|
|
|
pthread_rwlock_unlock(&_lock);
|
|
|
|
@ -271,7 +273,6 @@ static int __dir_read(void *m, sexp_t *sx)
|
|
|
|
|
goto __finish;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char dump[2048];
|
|
|
|
|
sprintf(dump, "(dir-entry (");
|
|
|
|
|
dump_dirent(item->dres, dump);
|
|
|
|
|
strcat(dump, "))");
|
|
|
|
@ -289,6 +290,8 @@ static int __dir_close(void *m, sexp_t *sx)
|
|
|
|
|
sexp_t *lsx = NULL;
|
|
|
|
|
sxmsg_t *msg = (sxmsg_t *)m;
|
|
|
|
|
int stid = -1;
|
|
|
|
|
datastream_t *item;
|
|
|
|
|
usrtc_node_t *node;
|
|
|
|
|
|
|
|
|
|
if (sexp_list_cdr(sx, &lsx) || !sx->list->next || !sx->list->next->val
|
|
|
|
|
|| (0 >= (stid = atoi(sx->list->next->val) )) )
|
|
|
|
@ -298,8 +301,6 @@ static int __dir_close(void *m, sexp_t *sx)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* get stream item */
|
|
|
|
|
datastream_t *item;
|
|
|
|
|
usrtc_node_t *node;
|
|
|
|
|
pthread_rwlock_rdlock(&_lock);
|
|
|
|
|
if ( !(node = usrtc_lookup(_rd_streams, &stid)) ) {
|
|
|
|
|
pthread_rwlock_unlock(&_lock);
|
|
|
|
|