From f7dc3983bd12bafc5534beb1315b6aa6daedfe71 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 16 Aug 2009 15:26:52 +0000 Subject: Modify THTTPD to avoid poll() for write ready git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2026 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/netutils/thttpd/fdwatch.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'nuttx/netutils/thttpd/fdwatch.h') diff --git a/nuttx/netutils/thttpd/fdwatch.h b/nuttx/netutils/thttpd/fdwatch.h index 4f960b56c..4a87c3280 100644 --- a/nuttx/netutils/thttpd/fdwatch.h +++ b/nuttx/netutils/thttpd/fdwatch.h @@ -58,21 +58,15 @@ * Private Types ****************************************************************************/ -struct fw_fd_s -{ - uint8 rw; /* Read or write fd */ - void *data; /* Retained client data */ -}; - struct fdwatch_s { - struct pollfd *pollfds; /* Poll data */ - struct fw_fd_s *client; /* Client data */ - uint8 *ready; /* The list of fds with activity */ - uint8 nfds; /* The configured maximum number of fds */ - uint8 nwatched; /* The number of fds currently watched */ - uint8 nactive; /* The number of fds with activity */ - uint8 next; /* The index to the next client data */ + struct pollfd *pollfds; /* Poll data */ + void **client; /* Client data */ + uint8 *ready; /* The list of fds with activity */ + uint8 nfds; /* The configured maximum number of fds */ + uint8 nwatched; /* The number of fds currently watched */ + uint8 nactive; /* The number of fds with activity */ + uint8 next; /* The index to the next client data */ }; /**************************************************************************** @@ -87,9 +81,9 @@ extern struct fdwatch_s *fdwatch_initialize(int nfds); extern void fdwatch_uninitialize(struct fdwatch_s *fw); -/* Add a descriptor to the watch list. rw is either FDW_READ or FDW_WRITE. */ +/* Add a descriptor to the watch list */ -extern void fdwatch_add_fd(struct fdwatch_s *fw, int fd, void *client_data, int rw); +extern void fdwatch_add_fd(struct fdwatch_s *fw, int fd, void *client_data); /* Delete a descriptor from the watch list. */ -- cgit v1.2.3