diff options
author | Christian Pointner <equinox@helsinki.at> | 2010-01-11 22:01:07 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2010-01-11 22:01:07 (GMT) |
commit | 37ccdda9932a28ca4b974760978f6d6234007059 (patch) | |
tree | 46c43067e80e3819fb213ba7c0ce5f719e321bf8 /utils.c | |
parent | d035636d833c393f86eb4eacb5c5934c94eb1a06 (diff) |
luaclient receiving data works now
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 30 |
1 files changed, 0 insertions, 30 deletions
@@ -110,36 +110,6 @@ int send_string(int fd, const char* string) return ret; } -int nonblock_recvline(read_buffer_t* buffer, int fd, cmd_t** cmd_q, client_t* client_lst, options_t* opt) -{ - int ret = 0; - for(;;) { - ret = recv(fd, &buffer->buf[buffer->offset], 1, 0); - if(!ret) - return 2; - if(ret == -1 && errno == EAGAIN) - return 0; - else if(ret < 0) - break; - - if(buffer->buf[buffer->offset] == '\n') { - buffer->buf[buffer->offset] = 0; - ret = process_cmd(buffer->buf, fd, cmd_q, client_lst, opt); - buffer->offset = 0; - break; - } - - buffer->offset++; - if(buffer->offset >= sizeof(buffer->buf)) { - log_printf(DEBUG, "string too long (fd=%d)", fd); - buffer->offset = 0; - return 0; - } - } - - return ret; -} - int setup_tty(int fd, speed_t speed) { struct termios tmio; |