Bullwinkle: Hey Rocky -- watch me pull a rabbit out of my hat. Rocky: Again?

This commit is contained in:
Ron Pedde 2005-11-17 07:20:50 +00:00
parent 381dc7eade
commit 6dba7aab41
2 changed files with 10 additions and 16 deletions

View File

@ -1254,7 +1254,7 @@ void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...) {
newmsg = strdup(buffer);
}
ws_lock_local_storage(config.server);
ws_lock_local_storage(pwsc);
if(!(pfirst = ws_get_local_storage(pwsc))) {
/* new info */
pfirst=(SCAN_STATUS*)malloc(sizeof(SCAN_STATUS));
@ -1280,7 +1280,7 @@ void config_set_status(WS_CONNINFO *pwsc, int session, char *fmt, ...) {
free(newmsg);
}
ws_unlock_local_storage(config.server);
ws_unlock_local_storage(pwsc);
DPRINTF(E_DBG,L_CONF,"Exiting config_set_status\n");
}

View File

@ -464,7 +464,7 @@ void *ws_mainthread(void *arg) {
* allocated memory has been freed
*/
void ws_close(WS_CONNINFO *pwsc) {
WS_PRIVATE *pwsp = (WS_PRIVATE *)pwsc->pwsp;
WS_PRIVATE *pwsp = (WS_PRIVATE *)(pwsc->pwsp);
DPRINTF(E_SPAM,L_WS,"Entering ws_close\n");
@ -485,10 +485,10 @@ void ws_close(WS_CONNINFO *pwsc) {
shutdown(pwsc->fd,SHUT_RDWR);
r_close(pwsc->fd);
/* this thread is done */
ws_remove_dispatch_thread(pwsp, pwsc);
/* Get rid of the local storage */
if(pwsc->local_storage) {
if(pwsc->storage_callback) {
pwsc->storage_callback(pwsc->local_storage);
@ -1566,21 +1566,17 @@ void ws_set_local_storage(WS_CONNINFO *pwsc, void *ptr, void (*callback)(void *)
* walk through the connection list and enumerate all the items
*/
WS_CONNINFO *ws_thread_enum_first(WSHANDLE wsh, WSTHREADENUM *vpp) {
WS_PRIVATE *pwsp;
WS_PRIVATE *pwsp = (WS_PRIVATE *)wsh;
WS_CONNINFO *pwsc = NULL;
WS_CONNLIST *pconlist;
pwsp = (WS_PRIVATE *)wsh;
ws_lock_connlist(pwsp);
pconlist = pwsp->connlist.next;
*vpp = (WSTHREADENUM)pconlist;
if(pconlist) {
pwsc = pconlist->pwsc;
}
*vpp = (WSTHREADENUM)pconlist;
if(pwsc == NULL) {
} else {
ws_unlock_connlist(pwsp);
}
@ -1588,12 +1584,10 @@ WS_CONNINFO *ws_thread_enum_first(WSHANDLE wsh, WSTHREADENUM *vpp) {
}
WS_CONNINFO *ws_thread_enum_next(WSHANDLE wsh, WSTHREADENUM *vpp) {
WS_PRIVATE *pwsp;
WS_PRIVATE *pwsp = (WS_PRIVATE *)wsh;
WS_CONNINFO *pwsc = NULL;
WS_CONNLIST *pconlist;
pwsp = (WS_PRIVATE *)wsh;
pconlist = (WS_CONNLIST*)*vpp;
if((!pconlist) || (!pconlist->next)) {
ws_unlock_connlist(pwsp);