chiark
/
gitweb
/
~ian
/
innduct.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cope with NNTP_STRLEN abolishment (replaced with NNTP_MAXLEN_COMMAND)
[innduct.git]
/
innduct.h
diff --git
a/innduct.h
b/innduct.h
index 65077d66b865a80f19d6fbe4a0e2be735ed3d4c6..69af7d95f348583294920895df7c26b16feae4d9 100644
(file)
--- a/
innduct.h
+++ b/
innduct.h
@@
-59,6
+59,7
@@
#include <time.h>
#include <math.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include <ctype.h>
+#include <limits.h>
#include <oop.h>
#include <oop-read.h>
#include <oop.h>
#include <oop-read.h>
@@
-84,8
+85,10
@@
#define DUMPV(fmt,pfx,v) fprintf(f, " " #v "=" fmt, pfx v);
#define DUMPV(fmt,pfx,v) fprintf(f, " " #v "=" fmt, pfx v);
-#define FOR_CONN(conn) \
- for ((conn)=LIST_HEAD(conns); (conn); (conn)=LIST_NEXT((conn)))
+#define FOR_LIST_NODE(nodevar, list) \
+ for ((nodevar)=LIST_HEAD(list); (nodevar); (nodevar)=LIST_NEXT((nodevar)))
+
+#define FOR_CONN(conn) FOR_LIST_NODE(conn, conns)
/*----- doubly linked lists -----*/
/*----- doubly linked lists -----*/
@@
-184,7
+187,7
@@
extern double max_bad_data_ratio;
extern int max_bad_data_initial;
extern int max_bad_data_initial;
-/*----- statistics -----*/
+/*-----
article states, and
statistics -----*/
typedef enum { /* in queue in conn->sent */
art_Unchecked, /* not checked, not sent checking */
typedef enum { /* in queue in conn->sent */
art_Unchecked, /* not checked, not sent checking */
@@
-218,6
+221,10
@@
typedef enum {
RCI_max
} ResultCountIndex;
RCI_max
} ResultCountIndex;
+typedef enum {
+ read_ok, read_blank, read_err, nooffer_missing,
+ ECI_max
+} EventCountIndex;
/*----- transmission buffers -----*/
/*----- transmission buffers -----*/
@@
-237,6
+244,11
@@
struct XmitDetails {
/*----- core operational data structure types -----*/
/*----- core operational data structure types -----*/
+typedef struct {
+ int results[art_MaxState][RCI_max];
+ int events[ECI_max];
+} Counts;
+
struct InputFile {
/* This is also an instance of struct oop_readable */
struct oop_readable readable; /* first */
struct InputFile {
/* This is also an instance of struct oop_readable */
struct oop_readable readable; /* first */
@@
-254,8
+266,7
@@
struct InputFile {
long inprogress; /* includes queue.count and also articles in conns */
long autodefer; /* -1 means not doing autodefer */
long inprogress; /* includes queue.count and also articles in conns */
long autodefer; /* -1 means not doing autodefer */
- int counts[art_MaxState][RCI_max];
- int readcount_ok, readcount_blank, readcount_err, count_nooffer_missing;
+ Counts counts;
char path[];
};
char path[];
};
@@
-313,13
+324,14
@@
void dbg(const char *fmt, ...) PRINTF(1,2);
void logv(int sysloglevel, const char *pfx, int errnoval,
const char *fmt, va_list al) PRINTF(5,0);
void logv(int sysloglevel, const char *pfx, int errnoval,
const char *fmt, va_list al) PRINTF(5,0);
-char *
x
vasprintf(const char *fmt, va_list al) PRINTF(1,0);
-char *
x
asprintf(const char *fmt, ...) PRINTF(1,2);
+char *
m
vasprintf(const char *fmt, va_list al) PRINTF(1,0);
+char *
m
asprintf(const char *fmt, ...) PRINTF(1,2);
int close_perhaps(int *fd);
void xclose(int fd, const char *what, const char *what2);
void xclose_perhaps(int *fd, const char *what, const char *what2);
int close_perhaps(int *fd);
void xclose(int fd, const char *what, const char *what2);
void xclose_perhaps(int *fd, const char *what, const char *what2);
-pid_t xfork(const char *what);
+pid_t xfork(const char *what); /* also runs postfork in child */
+pid_t xfork_bare(const char *what);
void on_fd_read_except(int fd, oop_call_fd callback);
void cancel_fd_read_except(int fd);
void on_fd_read_except(int fd, oop_call_fd callback);
void cancel_fd_read_except(int fd);
@@
-357,7
+369,7
@@
static inline int isewouldblock(int errnoval) {
INNLOGSET(die, "fatal", LOG_ERR) \
INNLOGSET(warn, "warning", LOG_WARNING) \
INNLOGSET(notice, "notice", LOG_NOTICE) \
INNLOGSET(die, "fatal", LOG_ERR) \
INNLOGSET(warn, "warning", LOG_WARNING) \
INNLOGSET(notice, "notice", LOG_NOTICE) \
- INNLOGSET(
trace, "trace", LOG_NOTICE
)
+ INNLOGSET(
debug, "debug", LOG_DEBUG
)
#define INNLOGSET_DECLARE(fn, pfx, sysloglevel) \
void duct_log_##fn(int l, const char *fmt, va_list al, int errval) \
PRINTF(3,0);
#define INNLOGSET_DECLARE(fn, pfx, sysloglevel) \
void duct_log_##fn(int l, const char *fmt, va_list al, int errval) \
PRINTF(3,0);
@@
-383,6
+395,10
@@
void conn_dispose(Conn *conn);
void vconnfail(Conn *conn, const char *fmt, va_list al) PRINTF(2,0);
void connfail(Conn *conn, const char *fmt, ...) PRINTF(2,3);
void vconnfail(Conn *conn, const char *fmt, va_list al) PRINTF(2,0);
void connfail(Conn *conn, const char *fmt, ...) PRINTF(2,3);
+void notice_conns_more(const char *new_kind);
+void notice_conns_fewer(void);
+void notice_conns_stats(void);
+
int allow_connect_start(void);
void connect_start(void);
int allow_connect_start(void);
void connect_start(void);
@@
-489,6
+505,8
@@
extern int until_stats_log;
extern StateMachineState sms;
extern int until_flush;
extern InputFile *main_input_file, *flushing_input_file, *backlog_input_file;
extern StateMachineState sms;
extern int until_flush;
extern InputFile *main_input_file, *flushing_input_file, *backlog_input_file;
+extern Counts backlog_counts;
+extern int backlog_counts_report;
extern FILE *defer;
extern int until_connect, until_backlog_nextscan;
extern double accept_proportion;
extern FILE *defer;
extern int until_connect, until_backlog_nextscan;
extern double accept_proportion;