aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfreebsd/rspamd.sh.in3
-rw-r--r--src/buffer.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/freebsd/rspamd.sh.in b/freebsd/rspamd.sh.in
index 9068907c4..5bb3a5cc2 100755
--- a/freebsd/rspamd.sh.in
+++ b/freebsd/rspamd.sh.in
@@ -19,7 +19,6 @@ procname="@CMAKE_INSTALL_PREFIX@/bin/rspamd"
restart_precmd="rspamd_checkconfig"
reload_precmd="rspamd_checkconfig"
configtest_cmd="rspamd_checkconfig"
-pidfile="/var/run/rspamd/rspamd.pid"
load_rc_config $name
@@ -28,6 +27,8 @@ load_rc_config $name
: ${rspamd_user="@RSPAMD_USER@"}
: ${rspamd_group="@RSPAMD_GROUP@"}
+pidfile="$rspamd_pidfile"
+
stop_postcmd="rm -f $rspamd_pidfile"
rspamd_checkconfig()
diff --git a/src/buffer.c b/src/buffer.c
index 33d0904f4..125c11686 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -201,7 +201,7 @@ read_buffers (int fd, rspamd_io_dispatcher_t *d, gboolean skip_read)
if (*c == '\n') {
res.begin = b;
res.len = r;
- if (*(c - 1) == '\r') {
+ if (r != 0 && *(c - 1) == '\r') {
res.len --;
}
if (d->read_callback) {