# arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
#
+2006-10-06 23:16:58 GMT Michael Poole <mdpoole@troilus.org> patch-56
+
+ Summary:
+ Remove "wants_reads" field from struct io_fd.
+ Revision:
+ srvx--devo--1.3--patch-56
+
+ Everybody wants read information, so give it to them!
+
+ src/ioset-epoll.c (ioset_epoll_events): Make EPOLLIN unconditional.
+
+ src/ioset-impl.h (fd_wants_reads): Delete.
+
+ src/ioset-select.c (ioset_select_loop): Unconditionally set read bit for fd.
+
+ src/ioset.c (ioset_add): Add fd to engine after marking it non-blocking.
+ (ioset_buffered_reads): Remove check for fd->wants_reads.
+
+ src/ioset.h (struct io_fd): Delete "wants_reads" field.
+
+ src/mod-qserver.c (qserver_readable): Add missing newline.
+ (qserver_accept): Delete assignment to fd->wants_reads.
+
+ src/mod-sockcheck.c (sockcheck_connected): Delete assignment to
+ fd->wants_reads.
+
+ src/proto-common.c (create_socket_client): Delete assignment to
+ fd->wants_reads.
+
+ modified files:
+ ChangeLog src/ioset-epoll.c src/ioset-impl.h
+ src/ioset-select.c src/ioset.c src/ioset.h src/mod-qserver.c
+ src/mod-sockcheck.c src/proto-common.c
+
+
2006-10-06 23:12:20 GMT Michael Poole <mdpoole@troilus.org> patch-55
Summary:
ioset_epoll_events(struct io_fd *fd)
{
return EPOLLHUP
- | (fd_wants_reads(fd) ? EPOLLIN : 0)
+ | EPOLLIN
| (fd_wants_writes(fd) ? EPOLLOUT : 0)
;
}
struct timeval;
-#define fd_wants_reads(FD) ((FD)->wants_reads || (FD)->state == IO_LISTENING)
#define fd_wants_writes(FD) (((FD)->send.get != (FD)->send.put) || (FD)->state == IO_CONNECTING)
struct io_engine {
if (!(fd = fds[nn]))
continue;
max_fd = nn;
- if (fd_wants_reads(fd))
- FD_SET(nn, &read_fds);
+ FD_SET(nn, &read_fds);
if (fd_wants_writes(fd))
FD_SET(nn, &write_fds);
}
res->fd = fd;
ioq_init(&res->send, 1024);
ioq_init(&res->recv, 1024);
- engine->add(res);
flags = fcntl(fd, F_GETFL);
fcntl(fd, F_SETFL, flags|O_NONBLOCK);
+ engine->add(res);
return res;
}
if (fd->recv.put == fd->recv.size)
fd->recv.put = 0;
fdnum = fd->fd;
- while (fd->wants_reads && (fd->line_len > 0)) {
+ while (fd->line_len > 0) {
struct io_fd *old_active;
int died = 0;
int fd;
void *data;
enum { IO_CLOSED, IO_LISTENING, IO_CONNECTING, IO_CONNECTED } state;
- unsigned int wants_reads : 1;
unsigned int line_reads : 1;
int line_len;
struct ioq send;
tmpline[--len] = '\0';
argc = split_line(tmpline, false, ArrayLength(argv), argv);
if (argc < 3) {
- ioset_printf(fd, "MISSING_ARGS");
+ ioset_printf(fd, "MISSING_ARGS\n");
return;
}
if (!strcmp(argv[1], "PASS")
client = calloc(1, sizeof(*client));
fd->data = client;
- fd->wants_reads = 1;
fd->line_reads = 1;
fd->readable_cb = qserver_readable;
fd->destroy_cb = qserver_destroy_fd;
return;
case 0: break;
}
- fd->wants_reads = 1;
if (SOCKCHECK_DEBUG) {
log_module(PC_LOG, LOG_INFO, "Connected: to %s port %d.", client->addr->hostname, client->state->port);
}
socket_io_fd->readable_cb = uplink_readable;
socket_io_fd->destroy_cb = socket_destroyed;
socket_io_fd->line_reads = 1;
- socket_io_fd->wants_reads = 1;
log_module(MAIN_LOG, LOG_INFO, "Connection to server established.");
cManager.uplink = target;
target->state = AUTHENTICATING;