author | Alberto Bertogli
<albertito@gmail.com> 2007-06-01 06:28:27 UTC |
committer | Alberto Bertogli
<albertito@gmail.com> 2007-06-01 06:28:27 UTC |
parent | b48cd139e5cf92c79e286df389ab430b7b41b8ba |
nmdb/tcp.c | +9 | -0 |
diff --git a/nmdb/tcp.c b/nmdb/tcp.c index a81e53f..c159315 100644 --- a/nmdb/tcp.c +++ b/nmdb/tcp.c @@ -99,6 +99,9 @@ static void rep_send_error(const struct req_info *req, const unsigned int code) uint32_t l, r, c; unsigned char minibuf[4 * 4]; + if (settings.passive) + return; + /* Network format: length (4), ID (4), REP_ERR (4), error code (4) */ l = htonl(4 + 4 + 4 + 4); r = htonl(REP_ERR); @@ -122,6 +125,9 @@ static int rep_send(const struct req_info *req, const unsigned char *buf, { int rv; + if (settings.passive) + return 1; + rv = send(req->fd, buf, size, 0); if (rv < 0) { rep_send_error(req, ERR_SEND); @@ -139,6 +145,9 @@ void tcp_mini_reply(struct req_info *req, uint32_t reply) uint32_t len; unsigned char minibuf[12]; + if (settings.passive) + return; + len = htonl(12); reply = htonl(reply); memcpy(minibuf, &len, 4);