Small SIP simplification
authorMark Spencer <markster@digium.com>
Wed, 30 Jul 2003 20:45:17 +0000 (20:45 +0000)
committerMark Spencer <markster@digium.com>
Wed, 30 Jul 2003 20:45:17 +0000 (20:45 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1242 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 1608b3f..7a58af1 100755 (executable)
@@ -888,19 +888,17 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner)
 static int find_user(struct sip_pvt *fup, int event)
 {
        char name[256] = "";
 static int find_user(struct sip_pvt *fup, int event)
 {
        char name[256] = "";
-       int isfound = 1;
        struct sip_user *u;
        strncpy(name, fup->username, sizeof(name) - 1);
        ast_pthread_mutex_lock(&userl.lock);
        u = userl.users;
        while(u) {
                if (!strcasecmp(u->name, name)) {
        struct sip_user *u;
        strncpy(name, fup->username, sizeof(name) - 1);
        ast_pthread_mutex_lock(&userl.lock);
        u = userl.users;
        while(u) {
                if (!strcasecmp(u->name, name)) {
-                       isfound = 0;
                        break;
                }
                u = u->next;
        }
                        break;
                }
                u = u->next;
        }
-       if ( isfound ) {
+       if (!u) {
                ast_log(LOG_DEBUG, "%s is not a local user\n", name);
                ast_pthread_mutex_unlock(&userl.lock);
                return 0;
                ast_log(LOG_DEBUG, "%s is not a local user\n", name);
                ast_pthread_mutex_unlock(&userl.lock);
                return 0;