r7786 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r7785‎ | r7786 | r7787 >
Date:16:14, 20 March 2005
Author:kateturner
Status:old
Tags:
Comment:
remove debug cruft, add header to smlogmsg
Modified paths:
  • /trunk/servmon/smlog.cxx (modified) (history)
  • /trunk/servmon/smlogmsg.c (modified) (history)
  • /trunk/servmon/smnet.cxx (modified) (history)

Diff [purge]

Index: trunk/servmon/smlog.cxx
@@ -11,43 +11,32 @@
1212 loglsnd(void) {
1313 }
1414 void start(void) {
15 - std::cerr << "starting log daemon\n";
1615 smnet::lsnrp s (new smnet::lsnr(smnet::unix));
17 - std::cerr << "created socket\n";
1816 std::remove("/tmp/servmon.log");
1917 s->node("/tmp/servmon.log");
20 - std::cerr << "set node\n";
2118 try {
2219 s->lsn();
23 - std::cerr << "listen\n";
2420 } catch (smnet::sckterr& e) {
2521 SMI(log)->logmsg(0, std::string("Listen failed for log socket: ") + e.what());
2622 return;
2723 }
28 - std::cerr << "listened\n";
2924 boost::function<void(smnet::scktp, int)> f =
3025 boost::bind(&loglsnd::newc, this, _1, _2);
3126 SMI(smnet::smpx)->add(f, static_pointer_cast<smnet::sckt>(s), smnet::smpx::srd);
32 - std::cerr << "added callback\n";
3327 }
3428 void newc(smnet::scktp sckt_, int) {
3529 smnet::lsnrp s = dynamic_pointer_cast<smnet::lsnr>(sckt_);
36 - std::cerr << "new client\n";
3730 try {
3831 smnet::clntp c = s->wt_acc();
39 - std::cerr << "accepted\n";
4032 boost::function<void(smnet::scktp, int)> f =
4133 boost::bind(&loglsnd::cdata, this, _1, _2);
4234 SMI(smnet::smpx)->add(f, static_pointer_cast<smnet::sckt>(c), smnet::smpx::srd);
43 - std::cerr << "added cb for client\n";
4435 } catch (smnet::sckterr& e) {
4536 SMI(log)->logmsg(0, std::string("Accept failed for log socket: ") + e.what());
46 - std::cerr << "got an error\n";
4737 }
4838 }
4939 void cdata(smnet::scktp s_, int) {
5040 smnet::clntp c = dynamic_pointer_cast<smnet::clnt>(s_);
51 - std::cerr << "got data for client\n";
5241 std::vector<u_char> data;
5342 std::string levs;
5443 std::string msg;
@@ -56,7 +45,6 @@
5746 } catch (smnet::sckterr&) {
5847 goto errout;
5948 }
60 - std::cerr << "read data\n";
6149 msg.assign(data.begin(), data.end());
6250 levs = smutl::car(msg);
6351 if (levs.empty()) {
@@ -79,7 +67,6 @@
8068 goto errout;
8169 SMI(log)->logmsg(lev, msg);
8270 errout:
83 - std::cerr << "removing socket";
8471 SMI(smnet::smpx)->rm(c);
8572 }
8673 };
Index: trunk/servmon/smnet.cxx
@@ -10,7 +10,6 @@
1111 this->type = type;
1212 if ((s = socket(ftype, SOCK_STREAM, 0)) < 0)
1313 throw sckterr();
14 - std::cerr << "new default socket " << s << "\n";
1514 if (type == internet) {
1615 struct sockaddr_in *sa = (sockaddr_in *)&sin;
1716 memset(sa, 0, sizeof *sa);
@@ -29,7 +28,6 @@
3029
3130 sckt::sckt(int type_, int s_, sockaddr const *sin_, socklen_t len)
3231 {
33 - std::cerr << "new socket from child " << s_ << "\n";
3432 std::memcpy(&sin, sin_, len);
3533 type = type_;
3634 s = s_;
@@ -37,7 +35,6 @@
3836 }
3937
4038 sckt::~sckt(void) {
41 - std::cerr << "deleting socket " << s << "\n";
4239 close(s);
4340 }
4441
Index: trunk/servmon/smlogmsg.c
@@ -1,3 +1,4 @@
 2+/* @(#) $Header$ */
23 #include <sys/socket.h>
34 #include <sys/un.h>
45

Status & tagging log