tAdd TCP mode - ratox - FIFO based tox client
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 9290ff8baa69f9afe77503a2c3694b1059b9d9aa
 (DIR) parent 39f8cd7c5cf07ec8dfd490c3366806c89b61eb25
 (HTM) Author: sin <sin@2f30.org>
       Date:   Tue, 23 Sep 2014 13:20:41 +0100
       
       Add TCP mode
       
       Diffstat:
         M config.def.h                        |       1 +
         M ratox.c                             |       9 ++++++++-
       
       2 files changed, 9 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/config.def.h b/config.def.h
       t@@ -1,6 +1,7 @@
        /* See LICENSE file for copyright and license details. */
        
        static int encryptdatafile = 0;
       +static int tcpenabled = 0;
        
        static struct node nodes[] = {
                {
 (DIR) diff --git a/ratox.c b/ratox.c
       t@@ -757,6 +757,7 @@ static int
        toxinit(void)
        {
                toxopt.ipv6enabled = ipv6;
       +        toxopt.udp_disabled = tcpenabled;
                tox = tox_new(&toxopt);
                dataload();
                datasave();
       t@@ -1246,7 +1247,10 @@ shutdown(void)
        static void
        usage(void)
        {
       -        fprintf(stderr, "usage: %s [-4|-6]\n", argv0);
       +        fprintf(stderr, "usage: %s [-4|-6] [-t]\n", argv0);
       +        fprintf(stderr, " -4\tIPv4 only\n");
       +        fprintf(stderr, " -6\tIPv6 only\n");
       +        fprintf(stderr, " -t\tEnable TCP mode (UDP by default)\n");
                exit(EXIT_FAILURE);
        }
        
       t@@ -1259,6 +1263,9 @@ main(int argc, char *argv[])
                case '6':
                        ipv6 = 1;
                        break;
       +        case 't':
       +                tcpenabled = 1;
       +                break;
                default:
                        usage();
                } ARGEND;