From 2819e3bcb8ae0ad5178c25ebea9ab704ccb67d61 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 13 Jul 2009 16:35:48 +0200 Subject: [PATCH] Replace some printf() in src/net with asserts --- src/net.cc | 7 +------ src/net.h | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/net.cc b/src/net.cc index 24b8f60bcb2..849d20f47b6 100644 --- a/src/net.cc +++ b/src/net.cc @@ -113,11 +113,7 @@ Connection::Init (void) Connection::~Connection () { static int i = 0; - if (socket_.fd > 0) { - printf("%d garbage collecting open Connection : %d\n", i++, socket_.fd); - printf(" socket->read_action: %p\n", socket_.read_action); - printf(" socket->write_action: %p\n", socket_.write_action); - } + assert(socket_.fd < 0 && "garbage collecting open Connection"); ForceClose(); } @@ -180,7 +176,6 @@ Connection::Connect (const Arguments& args) return ThrowException(String::New("Must specify a port.")); String::AsciiValue port_sv(args[0]->ToString()); - if (connection->port_) printf("connection->port_ = '%s'\n", connection->port_); assert(connection->port_ == NULL); connection->port_ = strdup(*port_sv); diff --git a/src/net.h b/src/net.h index 34c9d17885e..22d097506f3 100644 --- a/src/net.h +++ b/src/net.h @@ -90,8 +90,9 @@ private: Connection *connection = static_cast (s->data); connection->OnDisconnect(); - if (s->errorno) + if (s->errorno) { printf("socket died with error %d\n", s->errorno); + } assert(connection->attached_); connection->Detach();