Communication fix and extension.

- Removing unnecessary log flushing. Closes #498.

- Adding new BiF disconnect() that shuts a connection to a peer down.

- terminate_connection() now first flushes any still buffered log
  messages.
This commit is contained in:
Robin Sommer 2011-09-24 21:23:25 -07:00
parent 3b7806379c
commit d289db34db
5 changed files with 36 additions and 2 deletions

View file

@ -73,6 +73,7 @@ event remote_connection_handshake_done(p: event_peer)
$vc=vector(10, 20, 30),
$ve=empty_vector
]);
disconnect(p);
}
@TEST-END-FILE

View file

@ -51,7 +51,7 @@ event remote_connection_handshake_done(p: event_peer)
{
Log::add_filter(Test::LOG, [$name="f2", $path="test.failure", $pred=fail]);
local cid = [$orig_h=1.2.3.4, $orig_p=1234/tcp, $resp_h=2.3.4.5, $resp_p=80/tcp];
local cid = [$orig_h=1.2.3.4, $orig_p=1234/tcp, $resp_h=2.3.4.5, $resp_p=80/tcp];
local r: Log = [$t=network_time(), $id=cid, $status="success"];
@ -61,6 +61,7 @@ event remote_connection_handshake_done(p: event_peer)
Log::write(Test::LOG, [$t=network_time(), $id=cid, $status="failure", $country="UK"]);
Log::write(Test::LOG, [$t=network_time(), $id=cid, $status="success", $country="BR"]);
Log::write(Test::LOG, [$t=network_time(), $id=cid, $status="failure", $country="MX"]);
disconnect(p);
}
@TEST-END-FILE