}
+static const char *ErrRBLF_WrongFDFlags="StrBufTCP_read_buffered_line_fast: don't work with fdflags & O_NONBLOCK";
+static const char *ErrRBLF_SelectFailed="StrBufTCP_read_buffered_line_fast: Select failed without reason";
+static const char *ErrRBLF_NotEnoughSentFromServer="StrBufTCP_read_buffered_line_fast: No complete line was sent from peer";
/**
* \brief Read a line from socket
* flushes and closes the FD on error
}
fdflags = fcntl(*fd, F_GETFL);
- if ((fdflags & O_NONBLOCK) == O_NONBLOCK)
+ if ((fdflags & O_NONBLOCK) == O_NONBLOCK) {
+ *Error = ErrRBLF_WrongFDFlags;
return -1;
+ }
pch = NULL;
while ((nSuccessLess < timeout) && (pch == NULL)) {
*Error = strerror(errno);
close (*fd);
*fd = -1;
+ if (*Error == NULL)
+ *Error = ErrRBLF_SelectFailed;
return -1;
}
if (FD_ISSET(*fd, &rfds) != 0) {
*Pos = pos + len + 1;
return len - rlen;
}
+ *Error = ErrRBLF_NotEnoughSentFromServer;
return -1;
}
return nRead;
}
+const char *ErrRBB_too_many_selects = "StrBufReadBLOBBuffered: to many selects; aborting.";
/**
* \brief Input binary data from socket
* flushes and closes the FD on error
}
if (nSelects > 10) {
FlushStrBuf(IOBuf);
+ *Error = ErrRBB_too_many_selects;
return -1;
}
}