diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-01-03 15:20:09 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-01-03 15:20:09 +0200 |
commit | 85f2fd8d2772506911e95c3e4a0cb2538594b274 (patch) | |
tree | d486caebbec25a05024fcd9bfbf99efa6832c2a2 | |
parent | 6db017a32e379bb2eb7878771dea969f77c3168c (diff) | |
download | pies-85f2fd8d2772506911e95c3e4a0cb2538594b274.tar.gz pies-85f2fd8d2772506911e95c3e4a0cb2538594b274.tar.bz2 |
Minor changes
* configure.ac: Version 1.2.92
* src/ctl.c (ctlio_finalize_reply): Don't close connection on errors.
* src/pies.h (PIES_PRINTFLIKE): New macro.
(logmsg, logmsg_printf): Mark as printflike.
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/ctl.c | 22 | ||||
-rw-r--r-- | src/pies.h | 16 |
3 files changed, 21 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac index 1ee26ec..d1bb2a9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,8 @@ # This file is part of GNU Pies. -*- autoconf -*- -# Copyright (C) 2009-2015 Sergey Poznyakoff +# Copyright (C) 2009-2016 Sergey Poznyakoff # # GNU Pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # @@ -12,13 +12,13 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. AC_PREREQ([2.63]) -AC_INIT([GNU Pies], [1.2.91], [bug-pies@gnu.org.ua]) +AC_INIT([GNU Pies], [1.2.92], [bug-pies@gnu.org.ua]) AC_CONFIG_SRCDIR([src/pies.h]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.11 gnits tar-ustar dist-bzip2 std-options silent-rules]) # Enable silent rules by default: @@ -652,28 +652,20 @@ static void ctlio_finalize_reply (struct ctlio *io) { size_t size; char const *val; struct ctlbuf tmpbuf; - if (io->state & (CTL_INITIAL_STATE|CTL_AUTHENTICATED_STATE)) + val = http_get_header (io->input.headers, "connection"); + if (val) { - if (io->code / 100 == 2 || io->code == 401) - { - val = http_get_header (io->input.headers, "connection"); - if (val) - { - if (strcasecmp (val, "keep-alive") == 0) - /* nothing */; - else if (strcasecmp (val, "close") == 0) - io->state = CTL_END_STATE; - //FIXME: else? - } - } - else + if (strcasecmp (val, "keep-alive") == 0) + /* nothing */; + else if (strcasecmp (val, "close") == 0) io->state = CTL_END_STATE; + //FIXME: else? } if (io->state == CTL_END_STATE || io->state == CTL_ACTION_STATE) output_set_header (&io->output, "Connection", "close"); ctlbuf_init (&tmpbuf); @@ -1181,13 +1173,13 @@ ctl_open () exit (EX_UNAVAILABLE); } if (listen (fd, 8)) { logmsg (LOG_CRIT, "can't listen on control socket %s: %s", - strerror (errno)); + control.url->string, strerror (errno)); exit (EX_UNAVAILABLE); } register_socket (fd, ctl_accept, NULL, NULL, NULL); } @@ -416,26 +416,34 @@ int meta1parse (void); extern int diag_output; #define DIAG_OUTPUT(x) (diag_output & (x)) void diag_setup (int flags); -void logmsg (int prio, const char *fmt, ...); -void logmsg_printf (int prio, const char *fmt, ...); +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __attribute__(x) +#endif + +#ifndef PIES_PRINTFLIKE +# define PIES_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg))) +#endif + +void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); +void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); void logmsg_vprintf (int prio, const char *fmt, va_list ap); extern unsigned debug_level; extern int source_info_option; -void debug_msg (const char *fmt, ...); +void debug_msg (const char *fmt, ...) PIES_PRINTFLIKE(1,2); #define debug(lev, args) \ do \ if (debug_level >= lev) \ { \ if (source_info_option) \ - logmsg_printf (LOG_DEBUG, "%s:%lu:%s: ", \ + logmsg_printf (LOG_DEBUG, "%s:%d:%s: ", \ __FILE__, __LINE__, __FUNCTION__); \ debug_msg args; \ } \ while (0) |