diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-01 23:09:10 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-01-01 23:09:10 +0000 |
commit | b0fe3d62ce222a08711e8e5b1baac92a3a38274f (patch) | |
tree | 32de7a4f9362cf82034eac9437c4cf7d6cc00ab3 /usr.sbin/bgpd/bgpd.h | |
parent | 6cabb1abe96ce74073c96812753fe62daa7f8a68 (diff) |
now that imsg_get uses bigger buffers, one read call can put more than one
imsg into the buffer. since imsg_get by definition only returns one imsg we
missed the next imsg(s) until the next poll event on the socket in question,
building up a queue on that socket. didn't show up as a problem yet...
factor out imsg_read, which reads into the buffer. imsg_get now entirely
operates on the buffers and does not read(2) itself.
make all callers cope by calling imsg_read on poll events and calling
imsg_get in a loop until all imsgs are processed.
Diffstat (limited to 'usr.sbin/bgpd/bgpd.h')
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 0c3a48dada9..8e766659d9e 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.44 2003/12/28 14:34:30 henning Exp $ */ +/* $OpenBSD: bgpd.h,v 1.45 2004/01/01 23:09:08 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -294,6 +294,7 @@ int merge_config(struct bgpd_config *, struct bgpd_config *); /* imsg.c */ void imsg_init(struct imsgbuf *, int); +int imsg_read(struct imsgbuf *); int imsg_get(struct imsgbuf *, struct imsg *); int imsg_compose(struct imsgbuf *, int, u_int32_t, void *, u_int16_t); void imsg_free(struct imsg *); |