From: Vsevolod Stakhov Date: Mon, 2 Mar 2009 13:54:03 +0000 (+0300) Subject: * htonl->htons as port is uint16_t, so lower bytes are zeroed or undefined when call... X-Git-Tag: 0.2.7~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=619adf18842f66bc84613b5caffadbbf6dc02924;p=thirdparty%2Frspamd.git * htonl->htons as port is uint16_t, so lower bytes are zeroed or undefined when call htonl --- diff --git a/rspamd.conf.sample b/rspamd.conf.sample index 8fd0315f45..591f8876c3 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 d563e9cde1..cd8c4e3aaa 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) {