if(ServerConfIllegal(tmp_p) || !ServerConfAutoconn(tmp_p))
continue;
- /* don't allow ssl connections if ssl isn't setup */\r
- if(ServerConfSSL(tmp_p) && (!ssl_ok || !get_ssld_count()))\r
+ /* don't allow ssl connections if ssl isn't setup */
+ if(ServerConfSSL(tmp_p) && (!ssl_ok || !get_ssld_count()))
continue;
cltmp = tmp_p->class;
if(server_p == NULL)
return error;
- if(ServerConfSSL(server_p) && client_p->localClient->ssl_ctl == NULL)\r
- {\r
- return -5;\r
+ if(ServerConfSSL(server_p) && client_p->localClient->ssl_ctl == NULL)
+ {
+ return -5;
}
attach_server_conf(client_p, server_p);
{
static char msgbuf[BUFSIZE];
struct Capability *cap;
- char *t;
- int tl;
- t = msgbuf;
- tl = rb_sprintf(msgbuf, "TS ");
- t += tl;
+ if(has_id(target_p))
+ rb_strlcpy(msgbuf, " TS6", sizeof(msgbuf));
+ else
+ rb_strlcpy(msgbuf, " TS", sizeof(msgbuf));
+
+ if(IsSSL(target_p))
+ rb_strlcat(msgbuf, " SSL", sizeof(msgbuf));
if(!IsServer(target_p) || !target_p->serv->caps) /* short circuit if no caps */
- {
- msgbuf[2] = '\0';
- return msgbuf;
- }
+ return msgbuf + 1;
for (cap = captab; cap->cap; ++cap)
{
if(cap->cap & target_p->serv->caps)
- {
- tl = rb_sprintf(t, "%s ", cap->name);
- t += tl;
- }
+ rb_snprintf_append(msgbuf, sizeof(msgbuf), " %s", cap->name);
}
- t--;
- *t = '\0';
-
- return msgbuf;
+ return msgbuf + 1;
}
/*
ilog_error("rb_set_buffers failed for server");
/* Enable compression now */
- if(IsCapable(client_p, CAP_ZIP))\r
- {\r
- start_zlib_session(client_p);\r
- }\r
+ if(IsCapable(client_p, CAP_ZIP))
+ {
+ start_zlib_session(client_p);
+ }
sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, rb_current_time());
client_p->servptr = &me;
hdata.target = client_p;
call_hook(h_server_introduced, &hdata);
- rb_snprintf(note, sizeof(note), "Server: %s", client_p->name);\r
+ rb_snprintf(note, sizeof(note), "Server: %s", client_p->name);
rb_note(client_p->localClient->F, note);
/*
free_pre_client(client_p);
- if (!IsCapable(client_p, CAP_ZIP))\r
+ if (!IsCapable(client_p, CAP_ZIP))
send_pop_queue(client_p);
return 0;
#endif
(server_p->aftype == AF_INET ? "IPv4" : "?"));
- if(ServerConfSSL(server_p))\r
- {\r
- rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,\r
- NULL, 0, serv_connect_ssl_callback, \r
- client_p, ConfigFileEntry.connect_timeout);\r
- }\r
- else\r
- rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,\r
- NULL, 0, serv_connect_callback, \r
+ if(ServerConfSSL(server_p))
+ {
+ rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,
+ NULL, 0, serv_connect_ssl_callback,
+ client_p, ConfigFileEntry.connect_timeout);
+ }
+ else
+ rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,
+ NULL, 0, serv_connect_callback,
client_p, ConfigFileEntry.connect_timeout);
return 1;
}
(server_p->aftype == AF_INET ? "IPv4" : "?"), vhoststr);
- if(ServerConfSSL(server_p))\r
- rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,\r
- (struct sockaddr *) &myipnum,\r
- GET_SS_LEN(&myipnum), serv_connect_ssl_callback, client_p,\r
- ConfigFileEntry.connect_timeout);\r
- else\r
- rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,\r
- (struct sockaddr *) &myipnum,\r
- GET_SS_LEN(&myipnum), serv_connect_callback, client_p,\r
+ if(ServerConfSSL(server_p))
+ rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,
+ (struct sockaddr *) &myipnum,
+ GET_SS_LEN(&myipnum), serv_connect_ssl_callback, client_p,
+ ConfigFileEntry.connect_timeout);
+ else
+ rb_connect_tcp(client_p->localClient->F, (struct sockaddr *)&client_p->localClient->ip,
+ (struct sockaddr *) &myipnum,
+ GET_SS_LEN(&myipnum), serv_connect_callback, client_p,
ConfigFileEntry.connect_timeout);
return 1;
}
}
-static void\r
-serv_connect_ev(void *data)\r
-{\r
- struct Client *client_p = data;\r
- serv_connect_callback(client_p->localClient->F, RB_OK, client_p);\r
+static void
+serv_connect_ev(void *data)
+{
+ struct Client *client_p = data;
+ serv_connect_callback(client_p->localClient->F, RB_OK, client_p);
}
-static void\r
-serv_connect_ssl_callback(rb_fde_t *F, int status, void *data)\r
-{\r
- struct Client *client_p = data;\r
- rb_fde_t *xF[2];\r
- if(status != RB_OK)\r
- {\r
- /* XXX deal with failure */\r
- return;\r
- }\r
- rb_connect_sockaddr(F, (struct sockaddr *)&client_p->localClient->ip, sizeof(client_p->localClient->ip));\r
- rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Outgoing ssld connection");\r
- del_from_cli_fd_hash(client_p);\r
- client_p->localClient->F = xF[0];\r
- add_to_cli_fd_hash(client_p);\r
-\r
- client_p->localClient->ssl_ctl = start_ssld_connect(F, xF[1], rb_get_fd(xF[0]));\r
- SetSSL(client_p);\r
- rb_event_addonce("serv_connect_ev", serv_connect_ev, client_p, 1); \r
+static void
+serv_connect_ssl_callback(rb_fde_t *F, int status, void *data)
+{
+ struct Client *client_p = data;
+ rb_fde_t *xF[2];
+ if(status != RB_OK)
+ {
+ /* XXX deal with failure */
+ return;
+ }
+ rb_connect_sockaddr(F, (struct sockaddr *)&client_p->localClient->ip, sizeof(client_p->localClient->ip));
+ rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Outgoing ssld connection");
+ del_from_cli_fd_hash(client_p);
+ client_p->localClient->F = xF[0];
+ add_to_cli_fd_hash(client_p);
+
+ client_p->localClient->ssl_ctl = start_ssld_connect(F, xF[1], rb_get_fd(xF[0]));
+ SetSSL(client_p);
+ rb_event_addonce("serv_connect_ev", serv_connect_ev, client_p, 1);
}
/*
return;
}
- if(client_p->localClient->ssl_ctl == NULL)\r
+ if(client_p->localClient->ssl_ctl == NULL)
rb_connect_sockaddr(F, (struct sockaddr *)&client_p->localClient->ip, sizeof(client_p->localClient->ip));
/* Check the status */