comparison src/connect.c @ 367:b27f66555ba8

Reformated multiline comments to have leading asterisks on each line Now we use: /* ** comment */ This makes the indent style simpler, too.
author markus schnalke <meillo@marmaro.de>
date Thu, 20 Oct 2011 10:20:59 +0200
parents 41958685480d
children 19d57eb1b6a1
comparison
equal deleted inserted replaced
366:41958685480d 367:b27f66555ba8
1 /* MasqMail 1 /*
2 Copyright (C) 1999 Oliver Kurth 2 ** MasqMail
3 3 ** Copyright (C) 1999 Oliver Kurth
4 This program is free software; you can redistribute it and/or modify 4 **
5 it under the terms of the GNU General Public License as published by 5 ** This program is free software; you can redistribute it and/or modify
6 the Free Software Foundation; either version 2 of the License, or 6 ** it under the terms of the GNU General Public License as published by
7 (at your option) any later version. 7 ** the Free Software Foundation; either version 2 of the License, or
8 8 ** (at your option) any later version.
9 This program is distributed in the hope that it will be useful, 9 **
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 ** This program is distributed in the hope that it will be useful,
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 GNU General Public License for more details. 12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 ** GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License 14 **
15 along with this program; if not, write to the Free Software 15 ** You should have received a copy of the GNU General Public License
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */ 18 */
18 #include "masqmail.h" 19 #include "masqmail.h"
19 20
20 static GList* 21 static GList*
21 resolve_ip(GList *list, gchar *ip) 22 resolve_ip(GList *list, gchar *ip)
74 } 75 }
75 } 76 }
76 return NULL; 77 return NULL;
77 } 78 }
78 79
79 /* Given a list of resolver functions, this function 80 /*
80 resolve the host and tries to connect to the addresses 81 ** Given a list of resolver functions, this function
81 returned. If a connection attemp is timed out or refused, 82 ** resolve the host and tries to connect to the addresses
82 the next address is tried. 83 ** returned. If a connection attemp is timed out or refused,
83 84 ** the next address is tried.
84 TODO: the resolver functions might return duplicate addresses, 85 **
85 if attempt failed for one it should not be tried again. 86 ** TODO: the resolver functions might return duplicate addresses,
87 ** if attempt failed for one it should not be tried again.
86 */ 88 */
87
88 mxip_addr* 89 mxip_addr*
89 connect_resolvelist(int *psockfd, gchar *host, guint port, GList *res_func_list) 90 connect_resolvelist(int *psockfd, gchar *host, guint port, GList *res_func_list)
90 { 91 {
91 GList *res_node; 92 GList *res_node;
92 GList *addr_list; 93 GList *addr_list;
102 if (addr_list) { 103 if (addr_list) {
103 addr = connect_hostlist(psockfd, host, port, addr_list); 104 addr = connect_hostlist(psockfd, host, port, addr_list);
104 g_list_free(addr_list); 105 g_list_free(addr_list);
105 return addr; 106 return addr;
106 } 107 }
107 /* previous versions complained, until someone tried to use a hostname 108 /*
108 out there that begins with a digit. eg. '3dwars.de'. */ 109 ** previous versions complained, until someone tried
110 ** to use a hostname out there that begins with a
111 ** digit. eg. '3dwars.de'.
112 */
109 } 113 }
110 114
111 if (res_func_list == NULL) { 115 if (res_func_list == NULL) {
112 logwrite(LOG_ALERT, "res_funcs == NULL !!!\n"); 116 logwrite(LOG_ALERT, "res_funcs == NULL !!!\n");
113 exit(1); 117 exit(1);