summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-01-11 22:01:07 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-01-11 22:01:07 (GMT)
commit37ccdda9932a28ca4b974760978f6d6234007059 (patch)
tree46c43067e80e3819fb213ba7c0ce5f719e321bf8 /utils.c
parentd035636d833c393f86eb4eacb5c5934c94eb1a06 (diff)
luaclient receiving data works now
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/utils.c b/utils.c
index e046b9c..532d7e5 100644
--- a/utils.c
+++ b/utils.c
@@ -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;