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,5 +1,5 @@ | |||
1 | # This file is part of GNU Pies. -*- autoconf -*- | 1 | # This file is part of GNU Pies. -*- autoconf -*- |
2 | # Copyright (C) 2009-2015 Sergey Poznyakoff | 2 | # Copyright (C) 2009-2016 Sergey Poznyakoff |
3 | # | 3 | # |
4 | # GNU Pies is free software; you can redistribute it and/or modify | 4 | # GNU Pies is free software; you can redistribute it and/or modify |
5 | # it under the terms of the GNU General Public License as published by | 5 | # it under the terms of the GNU General Public License as published by |
@@ -15,7 +15,7 @@ | |||
15 | # along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | AC_PREREQ([2.63]) | 17 | AC_PREREQ([2.63]) |
18 | AC_INIT([GNU Pies], [1.2.91], [bug-pies@gnu.org.ua]) | 18 | AC_INIT([GNU Pies], [1.2.92], [bug-pies@gnu.org.ua]) |
19 | AC_CONFIG_SRCDIR([src/pies.h]) | 19 | AC_CONFIG_SRCDIR([src/pies.h]) |
20 | AC_CONFIG_AUX_DIR([build-aux]) | 20 | AC_CONFIG_AUX_DIR([build-aux]) |
21 | AC_CONFIG_HEADERS([config.h]) | 21 | AC_CONFIG_HEADERS([config.h]) |
@@ -655,22 +655,14 @@ ctlio_finalize_reply (struct ctlio *io) | |||
655 | char const *val; | 655 | char const *val; |
656 | struct ctlbuf tmpbuf; | 656 | struct ctlbuf tmpbuf; |
657 | 657 | ||
658 | if (io->state & (CTL_INITIAL_STATE|CTL_AUTHENTICATED_STATE)) | 658 | val = http_get_header (io->input.headers, "connection"); |
659 | if (val) | ||
659 | { | 660 | { |
660 | if (io->code / 100 == 2 || io->code == 401) | 661 | if (strcasecmp (val, "keep-alive") == 0) |
661 | { | 662 | /* nothing */; |
662 | val = http_get_header (io->input.headers, "connection"); | 663 | else if (strcasecmp (val, "close") == 0) |
663 | if (val) | ||
664 | { | ||
665 | if (strcasecmp (val, "keep-alive") == 0) | ||
666 | /* nothing */; | ||
667 | else if (strcasecmp (val, "close") == 0) | ||
668 | io->state = CTL_END_STATE; | ||
669 | //FIXME: else? | ||
670 | } | ||
671 | } | ||
672 | else | ||
673 | io->state = CTL_END_STATE; | 664 | io->state = CTL_END_STATE; |
665 | //FIXME: else? | ||
674 | } | 666 | } |
675 | 667 | ||
676 | if (io->state == CTL_END_STATE || io->state == CTL_ACTION_STATE) | 668 | if (io->state == CTL_END_STATE || io->state == CTL_ACTION_STATE) |
@@ -1184,7 +1176,7 @@ ctl_open () | |||
1184 | if (listen (fd, 8)) | 1176 | if (listen (fd, 8)) |
1185 | { | 1177 | { |
1186 | logmsg (LOG_CRIT, "can't listen on control socket %s: %s", | 1178 | logmsg (LOG_CRIT, "can't listen on control socket %s: %s", |
1187 | strerror (errno)); | 1179 | control.url->string, strerror (errno)); |
1188 | exit (EX_UNAVAILABLE); | 1180 | exit (EX_UNAVAILABLE); |
1189 | } | 1181 | } |
1190 | 1182 | ||
@@ -419,20 +419,28 @@ extern int diag_output; | |||
419 | 419 | ||
420 | void diag_setup (int flags); | 420 | void diag_setup (int flags); |
421 | 421 | ||
422 | void logmsg (int prio, const char *fmt, ...); | 422 | #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) |
423 | void logmsg_printf (int prio, const char *fmt, ...); | 423 | # define __attribute__(x) |
424 | #endif | ||
425 | |||
426 | #ifndef PIES_PRINTFLIKE | ||
427 | # define PIES_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg))) | ||
428 | #endif | ||
429 | |||
430 | void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); | ||
431 | void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); | ||
424 | void logmsg_vprintf (int prio, const char *fmt, va_list ap); | 432 | void logmsg_vprintf (int prio, const char *fmt, va_list ap); |
425 | 433 | ||
426 | extern unsigned debug_level; | 434 | extern unsigned debug_level; |
427 | extern int source_info_option; | 435 | extern int source_info_option; |
428 | void debug_msg (const char *fmt, ...); | 436 | void debug_msg (const char *fmt, ...) PIES_PRINTFLIKE(1,2); |
429 | 437 | ||
430 | #define debug(lev, args) \ | 438 | #define debug(lev, args) \ |
431 | do \ | 439 | do \ |
432 | if (debug_level >= lev) \ | 440 | if (debug_level >= lev) \ |
433 | { \ | 441 | { \ |
434 | if (source_info_option) \ | 442 | if (source_info_option) \ |
435 | logmsg_printf (LOG_DEBUG, "%s:%lu:%s: ", \ | 443 | logmsg_printf (LOG_DEBUG, "%s:%d:%s: ", \ |
436 | __FILE__, __LINE__, __FUNCTION__); \ | 444 | __FILE__, __LINE__, __FUNCTION__); \ |
437 | debug_msg args; \ | 445 | debug_msg args; \ |
438 | } \ | 446 | } \ |