]> git.tdb.fi Git - libs/net.git/commitdiff
Emit signal_end_of_file after clearing events
authorMikko Rasa <tdb@tdb.fi>
Fri, 9 Dec 2022 17:26:55 +0000 (19:26 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 9 Dec 2022 17:26:55 +0000 (19:26 +0200)
This ensures that the state remains consistent even if a slot throws.

source/net/clientsocket.cpp

index e07b1f60bcfa887fca56b85939be5417376ea2a6..9cabeef9c7714b7f743bf350b37c067d739714a2 100644 (file)
@@ -85,8 +85,8 @@ size_t ClientSocket::do_read(char *buf, size_t size)
        if(ret==0 && !eof_flag)
        {
                eof_flag = true;
-               signal_end_of_file.emit();
                set_socket_events(S_NONE);
+               signal_end_of_file.emit();
        }
 
        return ret;