#include "tincctl.h"
#include "top.h"
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
+
static char **orig_argv;
static int orig_argc;
FILE *f;
char *pubname, *privname;
+ // Make sure the key size is a multiple of 8 bits.
+ bits &= ~0x7;
+
+ // Force them to be between 1024 and 8192 bits long.
+ if(bits < 1024)
+ bits = 1024;
+ if(bits > 8192)
+ bits = 8192;
+
fprintf(stderr, "Generating %d bits keys:\n", bits);
if(!(key = rsa_generate(bits, 0x10001))) {
blen++;
while(blen) {
- int result = send(fd, p, blen, 0);
+ int result = send(fd, p, blen, MSG_NOSIGNAL);
if(result == -1 && errno == EINTR)
continue;
else if(result <= 0)
freeaddrinfo(res);
#endif
+#ifdef SO_NOSIGPIPE
+ static const int one = 1;
+ setsockopt(c, SOL_SOCKET, SO_NOSIGPIPE, (void *)&one, sizeof one);
+#endif
+
char data[4096];
int version;
free(fname);
}
+ closedir(dir);
+
return 0;
}