-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Successfully integrate linenoise with web server
In the previous version of console implementation, we tried to integrate tiny-web-server to enable the ability of processing commands from web requests. As the result, the package linenoise which is responsible for command-line auto-complete needs to be disabled during the running time of tiny-web-server. Because the `line_edit()` function in linenoise.c doesn't have the ability to handle web requests correctly. When we start the web server, we use `cmd_select` in console.c and use `select` system call to monitor web socket file descriptor and stdin_fd at the same time, however, this ability should present in the `line_edit` function in linenoise.c so we can process commands from command-line and from web requests at the same time. That's the reason I re-design the linenoise implementation and make some modification to put `select()` system call in `line_edit` so we can have the full ability to use web server and linenoise package in command-line at the same time.
- Loading branch information
Showing
4 changed files
with
60 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters