aboutsummaryrefslogtreecommitdiffstats
path: root/agni.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2017-02-25 00:52:06 +0000
committerFreeArtMan <dos21h@gmail.com>2017-02-25 00:52:06 +0000
commitfbf4aa43078f95d4ed3de0c9e897711bebf90eac (patch)
treef125fb51d27369eb9530809470ce0c7fe583eb2e /agni.c
parent58493553ec4d0efaca1c1adddcdeb00e94e881bf (diff)
downloadagni-fbf4aa43078f95d4ed3de0c9e897711bebf90eac.tar.gz
agni-fbf4aa43078f95d4ed3de0c9e897711bebf90eac.zip
removed new string creation function to util file
Diffstat (limited to 'agni.c')
-rw-r--r--agni.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/agni.c b/agni.c
index c1ac68f..a2f14a4 100644
--- a/agni.c
+++ b/agni.c
@@ -23,6 +23,9 @@
#include "buf.h"
#include "mq_cmd.h"
#include "tbl_qcmd.h"
+#include "util.h"
+#include "sock_conn.h"
+#include "irc_parse.h"
/*
no defence programming, no error checking, no argument checking just PoC
@@ -31,24 +34,6 @@ nothing else
#define MQ_MSG_SIZE 8192
-/*
-return fd!=ifconnection there
-*/
-int irc_connect( char *hostname, char *port )
-{
- int fd=0;
-
- struct addrinfo serv, *res;
-
- memset(&serv, 0, sizeof(serv));
- serv.ai_family = AF_INET;
- serv.ai_socktype = SOCK_STREAM;
- getaddrinfo(hostname, port, &serv, &res);
- fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
- connect(fd, res->ai_addr, res->ai_addrlen);
-
- return fd;
-}
/*
return unique ID, with atomic counter should work in all cases