tDebug info and real IPv6 support. - rohrpost - A commandline mail client to change the world as we see it.
 (HTM) git clone git://r-36.net/rohrpost
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit fb2a2e9b1cb1bfca824316633e2c18b7447d19a2
 (DIR) parent df8ffff19c2a6b84019a9eb888b4400652d24746
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Sat,  4 Feb 2017 12:37:12 +0100
       
       Debug info and real IPv6 support.
       
       Diffstat:
         imap.c                              |       2 +-
         mime.c                              |       4 ++--
         net.c                               |       2 +-
         parser.c                            |      21 +++++++++++++++++++--
       
       4 files changed, 23 insertions(+), 6 deletions(-)
       ---
 (DIR) diff --git a/imap.c b/imap.c
       t@@ -324,7 +324,7 @@ imap_cmd(imap_t *imap, char *cmd, ...)
                }
                va_end(ap);
        
       -        /* fprintf(stderr, "req: %s %s\n", tag, req); */
       +        //printf("%s %s\n", tag, req);
                net_printf(imap->fd, "%s %s\r\n", tag, req);
                free(tag);
                free(req);
 (DIR) diff --git a/mime.c b/mime.c
       t@@ -1212,8 +1212,8 @@ mime_decodepartencoding(mime_t *mime, int *len)
        {
                char *ret;
        
       -        //printf("ct = %s\n", mime->ct);
       -        //printf("cte = %s\n", mime->cte);
       +        //printf("ct = \"%s\"\n", mime->ct);
       +        //printf("cte = \"%s\"\n", mime->cte);
                ret = NULL;
                if (!strcasecmp(mime->cte, "base64")) {
                        *len = mime->bodylen;
 (DIR) diff --git a/net.c b/net.c
       t@@ -168,7 +168,7 @@ net_connecttcp(net_t *net)
                 * Anyone knowing a real check for IPv6, instead of failing
                 * everything, should contact me.
                 */
       -        hints.ai_family = AF_INET;
       +        hints.ai_family = AF_UNSPEC;
                hints.ai_socktype = SOCK_STREAM;
                hints.ai_protocol = IPPROTO_TCP;
                if (getaddrinfo(net->addr, net->service, &hints, &ai))
 (DIR) diff --git a/parser.c b/parser.c
       t@@ -54,10 +54,18 @@ parser_free(parser_t *parser)
        int
        parser_read(parser_t *parser, char *buf, int len)
        {
       +        //int r;
       +
                switch(parser->type) {
                case PARSER_NET:
       +                //r = net_read((net_t *)parser->struc, buf, len);
       +                //printf(buf);
       +                //return r;
                        return net_read((net_t *)parser->struc, buf, len);
                case PARSER_STRING:
       +                //r = strio_read((strio_t *)parser->struc, buf, len);
       +                //printf(buf);
       +                //return r;
                        return strio_read((strio_t *)parser->struc, buf, len);
                default:
                        break;
       t@@ -69,11 +77,19 @@ parser_read(parser_t *parser, char *buf, int len)
        int
        parser_readall(parser_t *parser, char *buf, int len)
        {
       +        int r;
       +
                switch(parser->type) {
                case PARSER_NET:
       -                return net_readall((net_t *)parser->struc, buf, len);
       +                r = net_readall((net_t *)parser->struc, buf, len);
       +                printf(buf);
       +                return r;
       +                //return net_readall((net_t *)parser->struc, buf, len);
                case PARSER_STRING:
       -                return strio_readall((strio_t *)parser->struc, buf, len);
       +                r = strio_readall((strio_t *)parser->struc, buf, len);
       +                printf(buf);
       +                return r;
       +                //return strio_readall((strio_t *)parser->struc, buf, len);
                default:
                        break;
                }
       t@@ -189,6 +205,7 @@ parsestructagain:
                i = 1;
                if (parser_read(parser, buf, 1) <= 0)
                        return NULL;
       +        //printf("%s", buf);
                switch (buf[0]) {
                case '{':
                        for (; parser_read(parser, &buf[i], 1) > 0 && i < sizeof(buf);