remote_pool.c
changeset 26 6d615203d963
parent 13 ee426f453cf5
--- a/remote_pool.c	Thu Jun 26 03:31:59 2008 +0300
+++ b/remote_pool.c	Sun Jul 06 23:33:24 2008 +0300
@@ -9,7 +9,7 @@
     memset(pool_info, 0, sizeof(*pool_info));
 }
 
-int remote_pool_add (struct remote_pool *pool_info, const char *hostname, const char *portname) {
+int remote_pool_add (struct remote_pool *pool_info, const char *addr_spec) {
     int i;
     struct remote_node *node_info = NULL;
     
@@ -21,12 +21,13 @@
         }
     }
 
-    if (!node_info) {
-        error("remote_pool_add: pool full, consider increasing REMOTE_POOL_MAX");
-        return -1;
-    }
+    if (!node_info)
+        ERROR("remote_pool_add: pool full, consider increasing REMOTE_POOL_MAX");
 
-    return remote_node_init(node_info, hostname, portname);
+    return remote_node_init(node_info, addr_spec);
+
+error:
+    return -1;
 }
 
 int remote_pool_load (struct remote_pool *pool_info, const char *filename) {
@@ -39,7 +40,7 @@
     }
     
     // read it in line-by-line
-    char line_buf[POOL_FILE_LINE_LENGTH], *hostname, *portname, *c;
+    char line_buf[POOL_FILE_LINE_LENGTH], *c;
     
     // non-ferror error indicator
     int error_flag = 0;
@@ -64,15 +65,9 @@
 
         if (*c == '\0')
             continue;
-        
-        // parse
-        if (!parse_hostport(line_buf, &hostname, &portname)) {
-            error_flag = 1;
-            break;
-        }
 
         // add it to the pool
-        if (remote_pool_add(pool_info, hostname, portname)) {
+        if (remote_pool_add(pool_info, line_buf)) {
             error_flag = 1;
             break;
         }