Index: trunk/servmon/smlog.cxx |
— | — | @@ -11,43 +11,32 @@ |
12 | 12 | loglsnd(void) { |
13 | 13 | } |
14 | 14 | void start(void) { |
15 | | - std::cerr << "starting log daemon\n"; |
16 | 15 | smnet::lsnrp s (new smnet::lsnr(smnet::unix)); |
17 | | - std::cerr << "created socket\n"; |
18 | 16 | std::remove("/tmp/servmon.log"); |
19 | 17 | s->node("/tmp/servmon.log"); |
20 | | - std::cerr << "set node\n"; |
21 | 18 | try { |
22 | 19 | s->lsn(); |
23 | | - std::cerr << "listen\n"; |
24 | 20 | } catch (smnet::sckterr& e) { |
25 | 21 | SMI(log)->logmsg(0, std::string("Listen failed for log socket: ") + e.what()); |
26 | 22 | return; |
27 | 23 | } |
28 | | - std::cerr << "listened\n"; |
29 | 24 | boost::function<void(smnet::scktp, int)> f = |
30 | 25 | boost::bind(&loglsnd::newc, this, _1, _2); |
31 | 26 | SMI(smnet::smpx)->add(f, static_pointer_cast<smnet::sckt>(s), smnet::smpx::srd); |
32 | | - std::cerr << "added callback\n"; |
33 | 27 | } |
34 | 28 | void newc(smnet::scktp sckt_, int) { |
35 | 29 | smnet::lsnrp s = dynamic_pointer_cast<smnet::lsnr>(sckt_); |
36 | | - std::cerr << "new client\n"; |
37 | 30 | try { |
38 | 31 | smnet::clntp c = s->wt_acc(); |
39 | | - std::cerr << "accepted\n"; |
40 | 32 | boost::function<void(smnet::scktp, int)> f = |
41 | 33 | boost::bind(&loglsnd::cdata, this, _1, _2); |
42 | 34 | SMI(smnet::smpx)->add(f, static_pointer_cast<smnet::sckt>(c), smnet::smpx::srd); |
43 | | - std::cerr << "added cb for client\n"; |
44 | 35 | } catch (smnet::sckterr& e) { |
45 | 36 | SMI(log)->logmsg(0, std::string("Accept failed for log socket: ") + e.what()); |
46 | | - std::cerr << "got an error\n"; |
47 | 37 | } |
48 | 38 | } |
49 | 39 | void cdata(smnet::scktp s_, int) { |
50 | 40 | smnet::clntp c = dynamic_pointer_cast<smnet::clnt>(s_); |
51 | | - std::cerr << "got data for client\n"; |
52 | 41 | std::vector<u_char> data; |
53 | 42 | std::string levs; |
54 | 43 | std::string msg; |
— | — | @@ -56,7 +45,6 @@ |
57 | 46 | } catch (smnet::sckterr&) { |
58 | 47 | goto errout; |
59 | 48 | } |
60 | | - std::cerr << "read data\n"; |
61 | 49 | msg.assign(data.begin(), data.end()); |
62 | 50 | levs = smutl::car(msg); |
63 | 51 | if (levs.empty()) { |
— | — | @@ -79,7 +67,6 @@ |
80 | 68 | goto errout; |
81 | 69 | SMI(log)->logmsg(lev, msg); |
82 | 70 | errout: |
83 | | - std::cerr << "removing socket"; |
84 | 71 | SMI(smnet::smpx)->rm(c); |
85 | 72 | } |
86 | 73 | }; |
Index: trunk/servmon/smnet.cxx |
— | — | @@ -10,7 +10,6 @@ |
11 | 11 | this->type = type; |
12 | 12 | if ((s = socket(ftype, SOCK_STREAM, 0)) < 0) |
13 | 13 | throw sckterr(); |
14 | | - std::cerr << "new default socket " << s << "\n"; |
15 | 14 | if (type == internet) { |
16 | 15 | struct sockaddr_in *sa = (sockaddr_in *)&sin; |
17 | 16 | memset(sa, 0, sizeof *sa); |
— | — | @@ -29,7 +28,6 @@ |
30 | 29 | |
31 | 30 | sckt::sckt(int type_, int s_, sockaddr const *sin_, socklen_t len) |
32 | 31 | { |
33 | | - std::cerr << "new socket from child " << s_ << "\n"; |
34 | 32 | std::memcpy(&sin, sin_, len); |
35 | 33 | type = type_; |
36 | 34 | s = s_; |
— | — | @@ -37,7 +35,6 @@ |
38 | 36 | } |
39 | 37 | |
40 | 38 | sckt::~sckt(void) { |
41 | | - std::cerr << "deleting socket " << s << "\n"; |
42 | 39 | close(s); |
43 | 40 | } |
44 | 41 | |
Index: trunk/servmon/smlogmsg.c |
— | — | @@ -1,3 +1,4 @@ |
| 2 | +/* @(#) $Header$ */ |
2 | 3 | #include <sys/socket.h> |
3 | 4 | #include <sys/un.h> |
4 | 5 | |