]>
Commit | Line | Data |
---|---|---|
cfd66529 AJ |
1 | #include "config.h" |
2 | #include "cbdata.h" | |
3 | #include "comm.h" | |
4 | #include "comm/Connection.h" | |
5 | ||
6 | Comm::Connection::Connection() : | |
7 | local(), | |
8 | remote(), | |
9 | _peer(NULL), | |
10 | peer_type(HIER_NONE), | |
11 | fd(-1), | |
12 | tos(0), | |
13 | flags(COMM_NONBLOCKING) | |
14 | {} | |
15 | ||
16 | Comm::Connection::Connection(Comm::Connection &c) : | |
17 | local(c.local), | |
18 | remote(c.remote), | |
19 | _peer(c._peer), | |
20 | peer_type(c.peer_type), | |
21 | fd(c.fd), | |
22 | tos(c.tos), | |
23 | flags(c.flags) | |
24 | {} | |
25 | ||
26 | Comm::Connection::~Connection() | |
27 | { | |
28 | if (fd >= 0) { | |
29 | comm_close(fd); | |
30 | } | |
31 | if (_peer) { | |
32 | cbdataReferenceDone(_peer); | |
33 | } | |
34 | } |