I don't think this is right.  Don't you want to test sess->server->haveawaynotify for every session on the list?
Here's what I think this section should look like:

    340    if (full)
    341    {
    342       list = sess_list;
    343       while (list)
    344       {
    345          sess = list->data;
    346          if (!sess->server->have_awaynotify)
    347             sess->done_away_check = FALSE;
    348          list = list->next;
    349       }
    350       loop++;
    351       if (loop < 2)
    352          goto doover;
    353    }

That would also fix the warning in my first comment, above.