Commit 3f473b93 authored by Andy Polyakov's avatar Andy Polyakov
Browse files

TLSProxy/Message.pm: refine end-of-conversation detection logic.

parent 5bb1cd22
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -267,15 +267,18 @@ sub get_messages
        }
    } elsif ($record->content_type == TLSProxy::Record::RT_ALERT) {
        my ($alertlev, $alertdesc) = unpack('CC', $record->decrypt_data);
        print "  [$alertlev, $alertdesc]\n";
        #A CloseNotify from the client indicates we have finished successfully
        #(we assume)
        if (!$end && !$server && $alertlev == AL_LEVEL_WARN
            && $alertdesc == AL_DESC_CLOSE_NOTIFY) {
            $success = 1;
        }
        #All alerts end the test
        #Fatal or close notify alerts end the test
        if ($alertlev == AL_LEVEL_FATAL || $alertdesc == AL_DESC_CLOSE_NOTIFY) {
            $end = 1;
        }
    }

    return @messages;
}