aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-02 16:54:03 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-02 16:54:03 +0300
commit619adf18842f66bc84613b5caffadbbf6dc02924 (patch)
tree6a91d3b2d469c19d8365d69735a436ffb3499ad5
parent3d6020ef1ed601e1f2db2a90f7b64d1a634db171 (diff)
downloadrspamd-619adf18842f66bc84613b5caffadbbf6dc02924.tar.gz
rspamd-619adf18842f66bc84613b5caffadbbf6dc02924.zip
* htonl->htons as port is uint16_t, so lower bytes are zeroed or undefined when call htonl
-rw-r--r--rspamd.conf.sample2
-rw-r--r--src/plugins/surbl.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/rspamd.conf.sample b/rspamd.conf.sample
index 8fd0315f4..591f8876c 100644
--- a/rspamd.conf.sample
+++ b/rspamd.conf.sample
@@ -102,7 +102,7 @@ delivery {
# SURBL module params, note that single quotes are mandatory here
.module 'surbl' {
# Address to redirector in host:port format
- #redirector = "localhost:8080";
+ redirector = "localhost:8080";
# Connect timeout for redirector
redirector_connect_timeout = "1s";
# IO timeout for redirector (may be usefull to set this value rather big)
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index d563e9cde..cd8c4e3aa 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -549,7 +549,7 @@ register_redirector_call (struct uri *url, struct worker_task *task)
bzero (&sc, sizeof (struct sockaddr_in *));
sc.sin_family = AF_INET;
- sc.sin_port = htonl (surbl_module_ctx->redirector_port);
+ sc.sin_port = htons (surbl_module_ctx->redirector_port);
memcpy (&sc.sin_addr, &surbl_module_ctx->redirector_addr, sizeof (struct in_addr));
s = socket (PF_INET, SOCK_STREAM, 0);
@@ -560,8 +560,8 @@ register_redirector_call (struct uri *url, struct worker_task *task)
}
/* set nonblocking */
- ofl = fcntl(s, F_GETFL, 0);
- fcntl(s, F_SETFL, ofl | O_NONBLOCK);
+ ofl = fcntl (s, F_GETFL, 0);
+ fcntl (s, F_SETFL, ofl | O_NONBLOCK);
if ((r = connect (s, (struct sockaddr*)&sc, sizeof (struct sockaddr_in))) == -1) {
if (errno != EINPROGRESS) {