diff options
Diffstat (limited to 'thing.c')
-rw-r--r-- | thing.c | 39 |
1 files changed, 1 insertions, 38 deletions
@@ -1,25 +1,4 @@ -#ifdef LOCAL -#define HOST "0.0.0.0" -#define PORT "6971" -#define SOCKETNAME "bees.sock" -#else -#define HOST "ubq323.website" -#define PORT "6667" -#define SOCKETNAME "/srv/apiobot/bees.sock" -#endif - -#ifdef DEBUG -#define DP(x) puts(x) -#else -#define DP(x) -#endif - -#define NICK "Bee" -#define USERNAME "apiobot" -#define REALNAME "apiobot" -#define CHANNEL "#a" - -#define SOCKETGROUP "apionet" +#include "conf.h" #include <stdio.h> #include <stdlib.h> @@ -37,22 +16,6 @@ #include <arpa/inet.h> #include <netinet/in.h> -ssize_t sendall(int sockfd, void *buf, size_t len) { - ssize_t total_sent = 0; - ssize_t sent; - do { - if ((sent = send(sockfd, buf+total_sent, len-total_sent, 0)) == -1) { - return -1; - } - total_sent += sent; - } while (total_sent < len); -#ifdef DEBUG - char *the = strndup(buf, len); - printf("SEND [%s]\n",the); - free(the); -#endif - return total_sent; -} int irc_connect() { struct addrinfo hints; |