- /* Try them one by one until we get a working one */
- for (clamhost=0; clamhost<num_clamhosts; ++clamhost) {
- extract_token(buf, clamhosts, clamhost, '|', sizeof buf);
- syslog(LOG_INFO, "Connecting to clamd at <%s>\n", buf);
-
- /* Assuming a host:port entry */
- extract_token(hostbuf, buf, 0, ':', sizeof hostbuf);
- if (extract_token(portbuf, buf, 1, ':', sizeof portbuf)==-1)
- /* Didn't specify a port so we'll try the psuedo-standard 3310 */
- sock = sock_connect(hostbuf, CLAMD_PORT);
- else
- /* Port specified lets try connecting to it! */
- sock = sock_connect(hostbuf, portbuf);
-
- if (sock >= 0) syslog(LOG_DEBUG, "Connected!\n");
- }
+ // Try them one by one until we get a working one
+ for (clamhost=0; clamhost<num_clamhosts; ++clamhost) {
+ extract_token(buf, clamhosts, clamhost, '|', sizeof buf);
+ syslog(LOG_INFO, "Connecting to clamd at <%s>\n", buf);
+
+ // Assuming a host:port entry
+ extract_token(hostbuf, buf, 0, ':', sizeof hostbuf);
+ if (extract_token(portbuf, buf, 1, ':', sizeof portbuf)==-1) {
+ // Didn't specify a port so we'll try the psuedo-standard 3310
+ sock = sock_connect(hostbuf, CLAMD_PORT);
+ }
+ else {
+ // Port specified lets try connecting to it!
+ sock = sock_connect(hostbuf, portbuf);
+ }
+
+ if (sock >= 0) {
+ syslog(LOG_DEBUG, "Connected!\n");
+ }
+ }