pnoltes commented on code in PR #851:
URL: https://github.com/apache/celix/pull/851#discussion_r4308008275
##########
bundles/shell/remote_shell/src/remote_shell.c:
##########
@@ -172,27 +175,42 @@ void *remoteShell_connection_run(void *data) {
/* The socket_fd has data available to be read */
if (result > 0 && FD_ISSET(fd, &connection->pollset)) {
- char buff[COMMAND_BUFF_SIZE];
-
- len = recv(fd, buff, COMMAND_BUFF_SIZE - 1, 0);
- if (len < COMMAND_BUFF_SIZE) {
- celix_status_t commandStatus = CELIX_SUCCESS;
- buff[len] = '\0';
-
- commandStatus =
remoteShell_connection_execute(connection, buff);
-
- if (commandStatus == CELIX_SUCCESS) {
-
remoteShell_connection_print(connection, RS_PROMPT);
- } else if (commandStatus ==
CELIX_FILE_IO_EXCEPTION) {
- //exit command
- break;
- } else { //error
-
remoteShell_connection_print(connection, RS_ERROR);
-
remoteShell_connection_print(connection, RS_PROMPT);
+ len = recv(fd, buff + used, COMMAND_BUFF_SIZE - 1 -
used, 0);
Review Comment:
done, also added a specific function to check `EAGAIN/EWOULDBLOCK`, so that
we can make this platform dependent in a cohesive way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]