summaryrefslogtreecommitdiff
path: root/servertest
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-10-19 19:40:16 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-10-19 19:40:16 +0000
commita712a5c11a23c7b7de000b166e00a3942e7bbafb (patch)
treed8bca7e04e6801b3719cd0744ff768cdd08b7786 /servertest
parentc8ab59eb8a2335dac9a49336cefeb646ef23eea0 (diff)
downloadirssi-a712a5c11a23c7b7de000b166e00a3942e7bbafb.zip
0.7.96 release updates
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@775 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'servertest')
-rw-r--r--servertest/server.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/servertest/server.c b/servertest/server.c
index 677e6b32..af3e4148 100644
--- a/servertest/server.c
+++ b/servertest/server.c
@@ -87,6 +87,7 @@ gint read_line(gboolean socket, gint handle, GString *output, GString *buffer)
}
void client_send(char *text)
{
+ if (strlen(text) > 508) text[508] = 0;
write(clienth, text, strlen(text));
write(clienth, "\r\n", 2);
}
@@ -99,12 +100,12 @@ void makerand(char *str, int len)
void makerand2(char *str, int len)
{
-#if 0
+#if 1
gchar c;
while (len > 0)
{
- c = rand() & 255;
+ c = (rand() % 20)+ 'A';
if (c != 0 && c != 13 && c != 10)
{
*str++ = c;
@@ -229,7 +230,7 @@ void send_cmd(void)
{
pos += sprintf(str+pos, "%s: ", clientnick);
}
- str[pos] = 'X';
+ str[pos] = 'X';
break;
}
@@ -352,25 +353,10 @@ int main(void)
static fd_set fdset;
struct timeval tv;
int serverh, port;
- IPADDR ip;
-
-#ifdef HAVE_IPV6
- if (net_gethostname("::1", &ip) != 0)
- {
- printf("net_gethostname()\n");
- return 1;
- }
-#else
- if (net_gethostname("127.0.0.1", &ip) != 0)
- {
- printf("net_gethostname()\n");
- return 1;
- }
-#endif
srand(0);
port = 6660;
- serverh = net_listen(&ip, &port);
+ serverh = net_listen(NULL, &port);
if (serverh == -1)
{
printf("listen()\n");