dac040ebba7bdf1482685a56e84a3afebed71cb7,w3af/core/data/url/handlers/keepalive/connection_manager.py,ConnectionManager,remove_connection,#ConnectionManager#Any#Any#Any#,32

Before Change


                msg = "%s was NOT removed from hostmap pool."
                debug(msg % conn)

            removed_from_free_or_used = False
            for lst in (self._free_conns, self._used_cons):
                try:
                    lst.remove(conn)
                except ValueError:
                    // I don"t care much about the connection not being in
                    // the free_conns or used_conns. This might happen because
                    // of a thread locking issue (basically, someone is not
                    // locking before moving connections around).
                    pass
                else:
                    removed_from_free_or_used = True

            if not removed_from_free_or_used:
                msg = "%s was NOT in free/used connection lists."
                debug(msg % conn)

            // If no more conns for "host", remove it from mapping
            conn_total = self.get_connections_total(host)
            if host and host in self._hostmap and not conn_total:
                del self._hostmap[host]

After Change


        if host:
            host_connections = self._hostmap.get(host, set())
            if conn in host_connections:
                host_connections.discard(conn)
                removed_from_hostmap = True

        else:
            // We don"t know the host. Need to find it by looping
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: andresriancho/w3af
Commit Name: dac040ebba7bdf1482685a56e84a3afebed71cb7
Time: 2018-01-10
Author: andres.riancho@gmail.com
File Name: w3af/core/data/url/handlers/keepalive/connection_manager.py
Class Name: ConnectionManager
Method Name: remove_connection


Project Name: mathics/Mathics
Commit Name: 5a8afe8256c9586a9dff05e4c16b69d53f5857ae
Time: 2016-08-08
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/inout.py
Class Name: On
Method Name: apply


Project Name: allenai/allennlp
Commit Name: 40ec35876d38c4797ad3ee9bf911b019faa5a61d
Time: 2017-08-25
Author: mattg@allenai.org
File Name: allennlp/nn/initializers.py
Class Name: InitializerApplicator
Method Name: __call__