read.c 800 Bytes
static
int
serverRead(Server this)
{
	unsigned int i;

	for (i=1; i<this->nfds; i++) {
		if (0 != ((this->fds)[i].revents & POLLIN)) {
			if (NULL == (this->conns)[i].reader) {
				loggerLog(
						this->logger,
						LOGGER_INFO,
						"initialization error: NULL reader");
				serverCloseConn(this, i);
			}

			switch (streamReaderRead((this->conns)[i].reader, (this->fds)[i].fd)) {
				case 0:
					/*
					 * normal close: write remaining data
					 * @TODO: actually we have no remaining data here....
					 */
					/* DROP-THROUGH */

				case -1: 
					/*
					 * read failure / close connection
					 */
					loggerLog(this->logger, LOGGER_INFO, "connection closed...");
					serverCloseConn(this, i);
					break;

				default:
					break;
			}
		}
	}
	
	return 0;
}

// vim: set ts=4 sw=4: