read.c 737 Bytes
static
int
serverRead(Server this, unsigned int i)
{
	int fd = (this->fds)[i].fd;
	int size;

	if (NULL == (this->conns)[fd].reader) {
		loggerLog(
				this->logger,
				LOGGER_INFO,
				"initialization error: NULL reader");
		return -1;
	}

	switch ((size = streamReaderRead((this->conns)[fd].reader, 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[%d] closed...%s",
					fd,
					inet_ntoa((((this->conns)[fd].sock)->addr).sin_addr));
			break;

		default:
			break;
	}

	return size;
}

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