mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-24 05:03:17 -05:00
add unique session ids
This commit is contained in:
parent
9bc76676b3
commit
c7b28232c2
@ -92,6 +92,7 @@ typedef struct tag_scan_status {
|
||||
|
||||
SCAN_STATUS scan_status = { 0,0,NULL,NULL };
|
||||
pthread_mutex_t scan_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
int config_session=0;
|
||||
|
||||
#define MAX_LINE 1024
|
||||
|
||||
@ -669,3 +670,16 @@ int config_mutex_unlock(void) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* return the next available session ID
|
||||
*/
|
||||
int config_get_next_session(void) {
|
||||
int session;
|
||||
config_mutex_lock();
|
||||
|
||||
session=++config_session;
|
||||
config_mutex_unlock();
|
||||
|
||||
return session;
|
||||
}
|
||||
|
@ -30,5 +30,6 @@ extern int config_write(CONFIG *pconfig);
|
||||
extern int config_auth(char *user, char *password);
|
||||
extern void config_handler(WS_CONNINFO *pwsc);
|
||||
extern void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...);
|
||||
extern int config_get_next_session(void);
|
||||
|
||||
#endif /* _CONFIGFILE_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user