]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/pop3client/serv_pop3client.c
Use IOBuffer with its StrBuf + const char* inside instead of having two of them
[citadel.git] / citadel / modules / pop3client / serv_pop3client.c
index 8a0693304611d418ec46e5ebc71ced13cc3f317d..40add14844bc815ec0486c27debf7b634bf9e8ac 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * Consolidate mail from remote POP3 accounts.
  *
  * Copyright (c) 2007-2009 by the citadel.org team
@@ -90,7 +88,7 @@ void pop3_do_fetching(char *roomname, char *pop3host, char *pop3user, char *pop3
        if (CtdlThreadCheckStop())
                return;
                
-       sock = sock_connect(pop3host, "110", "tcp");
+       sock = sock_connect(pop3host, "110");
        if (sock < 0) {
                CtdlLogPrintf(CTDL_ERR, "Could not connect: %s\n", strerror(errno));
                return;
@@ -100,9 +98,9 @@ void pop3_do_fetching(char *roomname, char *pop3host, char *pop3user, char *pop3
                goto bail;
 
        CtdlLogPrintf(CTDL_DEBUG, "Connected!\n");
-       CCC->sReadBuf = NewStrBuf();
+       CCC->SBuf.Buf = NewStrBuf();
        CCC->sMigrateBuf = NewStrBuf();
-       CCC->sPos = NULL;
+       CCC->SBuf.ReadWritePointer = NULL;
 
        /* Read the server greeting */
        if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
@@ -247,7 +245,7 @@ void pop3_do_fetching(char *roomname, char *pop3host, char *pop3user, char *pop3
        if (sock_getln(&sock, buf, sizeof buf) < 0) goto bail;
        CtdlLogPrintf(CTDL_DEBUG, ">%s\n", buf);
 bail:  
-       FreeStrBuf(&CCC->sReadBuf);
+       FreeStrBuf(&CCC->SBuf.Buf);
        FreeStrBuf(&CCC->sMigrateBuf);
 
        if (sock != -1)
@@ -308,7 +306,7 @@ void pop3client_scan(void) {
        static int doing_pop3client = 0;
        struct pop3aggr *pptr;
        time_t fastest_scan;
-       
+
        if (config.c_pop3_fastest < config.c_pop3_fetch)
                fastest_scan = config.c_pop3_fastest;
        else
@@ -357,5 +355,5 @@ CTDL_MODULE_INIT(pop3client)
        }
        
        /* return our Subversion id for the Log */
-        return "$Id$";
+        return "pop3client";
 }