In nsd/driver.c:NsTclUploadStatsObjCmd

   while (drvPtr != NULL) {
       Tcl_HashEntry *hPtr;
       spPtr = &drvPtr->spooler;
       Ns_MutexLock(&spPtr->lock);
       hPtr = Tcl_FindHashEntry(&spPtr->table, Tcl_GetString(objv[1]));
       if (hPtr != NULL) {
           Sock *sockPtr = (Sock *)Tcl_GetHashValue(hPtr);
           UploadStats *statsPtr = &sockPtr->upload;
           sprintf(buf, "%lu %lu", statsPtr->length, statsPtr->size);
           break;
       }
       Ns_MutexUnlock(&spPtr->lock);
       drvPtr = drvPtr->nextPtr;
   }

If the command is successful in finding the correct stats, the loop is
exited with break.  In this case, the mutex is never unlocked, right?

No tests...  :-(

Reply via email to