mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-29 16:53:43 -04:00
fix some more trivial problems
This commit is contained in:
parent
51274d7b03
commit
5733445333
@ -1259,7 +1259,7 @@ void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...) {
|
|||||||
/* new info */
|
/* new info */
|
||||||
pfirst=(SCAN_STATUS*)malloc(sizeof(SCAN_STATUS));
|
pfirst=(SCAN_STATUS*)malloc(sizeof(SCAN_STATUS));
|
||||||
if(pfirst) {
|
if(pfirst) {
|
||||||
pfirst->what = NULL;
|
pfirst->what = NULL;
|
||||||
pfirst->thread = pwsc->threadno;
|
pfirst->thread = pwsc->threadno;
|
||||||
pfirst->host = strdup(pwsc->hostname);
|
pfirst->host = strdup(pwsc->hostname);
|
||||||
ws_set_local_storage(pwsc,pfirst,config_freescan);
|
ws_set_local_storage(pwsc,pfirst,config_freescan);
|
||||||
|
@ -825,6 +825,11 @@ int db_sqlite_enum_start(DBQUERYINFO *pinfo) {
|
|||||||
db_sqlite_unlock();
|
db_sqlite_unlock();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if(!rows) {
|
||||||
|
DPRINTF(E_LOG,L_DB|L_DAAP,"Could not find playlist %d\n",pinfo->playlist_id);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
is_smart=(atoi(resarray[2]) == 1);
|
is_smart=(atoi(resarray[2]) == 1);
|
||||||
have_clause=1;
|
have_clause=1;
|
||||||
if(is_smart) {
|
if(is_smart) {
|
||||||
|
@ -65,7 +65,6 @@ typedef struct tag_ws_handler {
|
|||||||
|
|
||||||
typedef struct tag_ws_connlist {
|
typedef struct tag_ws_connlist {
|
||||||
WS_CONNINFO *pwsc;
|
WS_CONNINFO *pwsc;
|
||||||
char *status;
|
|
||||||
struct tag_ws_connlist *next;
|
struct tag_ws_connlist *next;
|
||||||
} WS_CONNLIST;
|
} WS_CONNLIST;
|
||||||
|
|
||||||
@ -293,8 +292,6 @@ void ws_remove_dispatch_thread(WS_PRIVATE *pwsp, WS_CONNINFO *pwsc) {
|
|||||||
|
|
||||||
pTail->next = pHead->next;
|
pTail->next = pHead->next;
|
||||||
|
|
||||||
if(pHead->status)
|
|
||||||
free(pHead->status);
|
|
||||||
free(pHead);
|
free(pHead);
|
||||||
|
|
||||||
/* signal condition in case something is waiting */
|
/* signal condition in case something is waiting */
|
||||||
@ -319,7 +316,6 @@ void ws_add_dispatch_thread(WS_PRIVATE *pwsp, WS_CONNINFO *pwsc) {
|
|||||||
pNew=(WS_CONNLIST*)malloc(sizeof(WS_CONNLIST));
|
pNew=(WS_CONNLIST*)malloc(sizeof(WS_CONNLIST));
|
||||||
pNew->next=NULL;
|
pNew->next=NULL;
|
||||||
pNew->pwsc=pwsc;
|
pNew->pwsc=pwsc;
|
||||||
pNew->status=strdup("Initializing");
|
|
||||||
|
|
||||||
if(!pNew)
|
if(!pNew)
|
||||||
DPRINTF(E_FATAL,L_WS,"Malloc: %s\n",strerror(errno));
|
DPRINTF(E_FATAL,L_WS,"Malloc: %s\n",strerror(errno));
|
||||||
@ -1557,9 +1553,10 @@ void ws_unlock_local_storage(WS_CONNINFO *pwsc) {
|
|||||||
*/
|
*/
|
||||||
void ws_set_local_storage(WS_CONNINFO *pwsc, void *ptr, void (*callback)(void *)) {
|
void ws_set_local_storage(WS_CONNINFO *pwsc, void *ptr, void (*callback)(void *)) {
|
||||||
if(!pwsc)
|
if(!pwsc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(pwsc->local_storage) {
|
if(pwsc->local_storage) {
|
||||||
|
DPRINTF(E_FATAL,L_WS,"ls already allocated");
|
||||||
if(pwsc->storage_callback) {
|
if(pwsc->storage_callback) {
|
||||||
pwsc->storage_callback(pwsc->local_storage);
|
pwsc->storage_callback(pwsc->local_storage);
|
||||||
pwsc->local_storage=NULL;
|
pwsc->local_storage=NULL;
|
||||||
@ -1579,11 +1576,12 @@ WS_CONNINFO *ws_thread_enum_first(WSHANDLE wsh, WSTHREADENUM *vpp) {
|
|||||||
WS_CONNLIST *pconlist;
|
WS_CONNLIST *pconlist;
|
||||||
|
|
||||||
pwsp = (WS_PRIVATE *)wsh;
|
pwsp = (WS_PRIVATE *)wsh;
|
||||||
|
|
||||||
ws_lock_connlist(pwsp);
|
ws_lock_connlist(pwsp);
|
||||||
|
|
||||||
pconlist = pwsp->connlist.next;
|
pconlist = pwsp->connlist.next;
|
||||||
if(pconlist) {
|
if(pconlist) {
|
||||||
pwsc = pconlist->pwsc;
|
pwsc = pconlist->pwsc;
|
||||||
}
|
}
|
||||||
*vpp = (WSTHREADENUM)pconlist;
|
*vpp = (WSTHREADENUM)pconlist;
|
||||||
|
|
||||||
@ -1600,7 +1598,7 @@ WS_CONNINFO *ws_thread_enum_next(WSHANDLE wsh, WSTHREADENUM *vpp) {
|
|||||||
WS_CONNLIST *pconlist;
|
WS_CONNLIST *pconlist;
|
||||||
|
|
||||||
pwsp = (WS_PRIVATE *)wsh;
|
pwsp = (WS_PRIVATE *)wsh;
|
||||||
|
|
||||||
pconlist = (WS_CONNLIST*)*vpp;
|
pconlist = (WS_CONNLIST*)*vpp;
|
||||||
if((!pconlist) || (!pconlist->next)) {
|
if((!pconlist) || (!pconlist->next)) {
|
||||||
ws_unlock_connlist(pwsp);
|
ws_unlock_connlist(pwsp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user