|
@@ -35,14 +35,14 @@
|
|
|
#include <poll.h>
|
|
#include <poll.h>
|
|
|
#include <signal.h>
|
|
#include <signal.h>
|
|
|
|
|
|
|
|
-#include <readline/readline.h>
|
|
|
|
|
-#include <readline/history.h>
|
|
|
|
|
-
|
|
|
|
|
#include <klist.h>
|
|
#include <klist.h>
|
|
|
#include <vcc/vcc.h>
|
|
#include <vcc/vcc.h>
|
|
|
#include <vcc/version.h>
|
|
#include <vcc/version.h>
|
|
|
#include <vcc/pretty.h>
|
|
#include <vcc/pretty.h>
|
|
|
|
|
|
|
|
|
|
+/* we tried to use libreadline, but after using that, we feel strange
|
|
|
|
|
+ * because... because of what? i don't know. */
|
|
|
|
|
+
|
|
|
#define DEFAULT_RATE 1000
|
|
#define DEFAULT_RATE 1000
|
|
|
|
|
|
|
|
|
|
|
|
@@ -149,8 +149,6 @@ int parse_args(char **argv, int *port, char **ip) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int do_handle_command(char *buf) {
|
|
int do_handle_command(char *buf) {
|
|
|
- add_history(buf);
|
|
|
|
|
-
|
|
|
|
|
if (*buf == '-')
|
|
if (*buf == '-')
|
|
|
do_cmd(buf);
|
|
do_cmd(buf);
|
|
|
|
|
|
|
@@ -243,8 +241,11 @@ int main(int argc, char **argv) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (fds[0].revents & POLLIN)
|
|
|
|
|
- rl_callback_read_char();
|
|
|
|
|
|
|
+ if (fds[0].revents & POLLIN) {
|
|
|
|
|
+ read(0, buf, MSG_SIZE);
|
|
|
|
|
+
|
|
|
|
|
+ do_handle_command(buf);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (fds[1].revents & POLLIN) {
|
|
if (fds[1].revents & POLLIN) {
|
|
|
size = read(fd, req, REQ_SIZE);
|
|
size = read(fd, req, REQ_SIZE);
|