X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=b05f74da69b62d3fd3a25a7ac58633f1628c1249;hp=c70c658cda6eb6c4aa92ffd305d99bd72f32c92c;hb=de4ed577b6019b9b83466c2c893ff02bb5d833f5;hpb=ec58ecae85b1491efb1c25d78d83bc83b9e6a10b diff --git a/net.c b/net.c index c70c658c..b05f74da 100644 --- a/net.c +++ b/net.c @@ -39,11 +39,11 @@ static struct crypt_data *crypt_data_array; * activate encryption for one file descriptor * * \param fd the file descriptor - * \param recv the function used for decrypting received data - * \param send the function used for encrypting before sending + * \param recv_f the function used for decrypting received data + * \param send_f the function used for encrypting before sending * \param private_data user data supplied by the caller */ -void enable_crypt(int fd, crypt_function *recv, crypt_function *send, +void enable_crypt(int fd, crypt_function *recv_f, crypt_function *send_f, void *private_data) { if (fd + 1 > cda_size) { @@ -53,8 +53,8 @@ void enable_crypt(int fd, crypt_function *recv, crypt_function *send, (fd + 1 - cda_size) * sizeof(struct crypt_data)); cda_size = fd + 1; } - crypt_data_array[fd].recv = recv; - crypt_data_array[fd].send = send; + crypt_data_array[fd].recv = recv_f; + crypt_data_array[fd].send = send_f; crypt_data_array[fd].private_data = private_data; PARA_INFO_LOG("rc4 encryption activated for fd %d\n", fd); } @@ -578,8 +578,11 @@ int recv_pattern(int fd, const char *pattern, size_t bufsize) goto out; ret = 1; out: - if (ret < 0) - PARA_NOTICE_LOG("did not receive pattern '%s'\n", pattern); + if (ret < 0) { + PARA_NOTICE_LOG("n = %d, did not receive pattern '%s'\n", n, pattern); + if (n > 0) + PARA_NOTICE_LOG("recvd: %s\n", buf); + } free(buf); return ret; }