You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
737 B
41 lines
737 B
static
|
|
int
|
|
serverRead(Server this, unsigned int i)
|
|
{
|
|
int fd = (this->fds)[i].fd;
|
|
int size;
|
|
|
|
if (NULL == (this->conns)[fd].worker) {
|
|
loggerLog(
|
|
this->logger,
|
|
LOGGER_INFO,
|
|
"initialization error: NULL reader");
|
|
return -1;
|
|
}
|
|
|
|
switch ((size = streamReaderRead((this->conns)[fd].worker, 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:
|