diff --git a/configure.in b/configure.in index 2852464b38..c6616f9ef7 100644 --- a/configure.in +++ b/configure.in @@ -139,7 +139,9 @@ if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; fi LIBS="$saved_LIBS -lcrypto" -AC_CHECK_HEADERS(unistd.h string.h signal.h netdb.h ctype.h sys/poll.h sys/types.h sys/fcntl.h sys/ioctl.h sys/socket.h sys/time.h netinet/in.h arpa/inet.h errno.h assert.h, , AC_MSG_WARN(some headers were not found, compilation may fail)) +dnl The warning message here is no longer strictly accurate. + +AC_CHECK_HEADERS(unistd.h string.h signal.h netdb.h ctype.h poll.h sys/poll.h sys/types.h sys/fcntl.h sys/ioctl.h sys/socket.h sys/time.h netinet/in.h arpa/inet.h errno.h assert.h, , AC_MSG_WARN(some headers were not found, compilation may fail)) AC_OUTPUT(Makefile src/Makefile src/common/Makefile src/smtpap/Makefile src/orkeygen/Makefile src/httpap/Makefile src/or/Makefile) diff --git a/src/common/Makefile.am b/src/common/Makefile.am index cc585e5a84..40b495ad65 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -3,9 +3,9 @@ noinst_LIBRARIES = libor.a #CFLAGS = -Wall -Wpointer-arith -O2 -libor_a_SOURCES = config.c log.c utils.c crypto.c +libor_a_SOURCES = config.c log.c utils.c crypto.c fakepoll.c noinst_HEADERS = config.h log.h \ policies.h utils.h \ - ss.h version.h crypto.h + ss.h version.h crypto.h fakepoll.h diff --git a/src/common/crypto.c b/src/common/crypto.c index 2a457897a1..40aaa319b6 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -508,7 +508,7 @@ int crypto_cipher_decrypt_init_cipher(crypto_cipher_env_t *env) return 0; } -int crypto_cipher_encrypt(crypto_cipher_env_t *env, unsigned char *from, size_t fromlen, unsigned char *to) +int crypto_cipher_encrypt(crypto_cipher_env_t *env, unsigned char *from, unsigned int fromlen, unsigned char *to) { int tolen; @@ -517,7 +517,7 @@ int crypto_cipher_encrypt(crypto_cipher_env_t *env, unsigned char *from, size_t return !(EVP_EncryptUpdate((EVP_CIPHER_CTX *)env->aux, to, &tolen, from, fromlen)); } -int crypto_cipher_decrypt(crypto_cipher_env_t *env, unsigned char *from, size_t fromlen, unsigned char *to) +int crypto_cipher_decrypt(crypto_cipher_env_t *env, unsigned char *from, unsigned int fromlen, unsigned char *to) { int tolen; diff --git a/src/common/utils.c b/src/common/utils.c index 1a6fa6498d..70094e8857 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -8,8 +8,11 @@ /* * Changes : * $Log$ - * Revision 1.1 2002/06/26 22:45:50 arma - * Initial revision + * Revision 1.2 2002/09/03 18:44:23 nickm + * Port to MacOS X + * + * Revision 1.1.1.1 2002/06/26 22:45:50 arma + * initial commit: current code * * Revision 1.6 2002/03/03 00:06:45 mp292 * Modifications to support re-transmission. @@ -38,6 +41,7 @@ #include #include #include +#include #include "utils.h" #include "log.h" diff --git a/src/httpap/httpap.c b/src/httpap/httpap.c index 22d6df0b64..42801caef0 100644 --- a/src/httpap/httpap.c +++ b/src/httpap/httpap.c @@ -8,6 +8,9 @@ /* * Changes : * $Log$ + * Revision 1.7 2002/09/03 18:44:23 nickm + * Port to MacOS X + * * Revision 1.6 2002/08/24 07:56:22 arma * proxies send port in host order as ascii string * @@ -45,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -53,7 +57,6 @@ #include #include #include -#include #include #include #include diff --git a/src/or/config.c b/src/or/config.c index 7a7be11369..dc1a03c440 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -10,7 +10,19 @@ */ #include "or.h" -#include +#include + +const char * +basename(const char *filename) +{ + char *result; + /* XXX This won't work on windows. */ + result = strrchr(filename, '/'); + if (result) + return result; + else + return filename; +} /* loads the configuration file */ int getconfig(char *conf_filename, config_opt_t *options) diff --git a/src/or/main.c b/src/or/main.c index 2b9fefa529..f755c4fd88 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -12,8 +12,9 @@ int global_role; static connection_t *connection_array[MAXCONNECTIONS] = { NULL }; -static struct pollfd poll_array[MAXCONNECTIONS] = - { [0 ... MAXCONNECTIONS-1] = { -1, 0, 0 } }; +static struct pollfd poll_array[MAXCONNECTIONS]; +/* = { [0 ... MAXCONNECTIONS-1] = { -1, 0, 0 } }; + */ static int nfds=0; /* number of connections currently active */ diff --git a/src/or/onion.c b/src/or/onion.c index b414989092..7908a3d976 100644 --- a/src/or/onion.c +++ b/src/or/onion.c @@ -124,6 +124,7 @@ unsigned int *new_route(double cw, routerinfo_t **rarray, int rarray_len, int *r num_acceptable_routers++; log(LOG_DEBUG,"I like %d. num_acceptable_routers now %d.",i, num_acceptable_routers); next_i_loop: + ; } if(num_acceptable_routers < *routelen) { diff --git a/src/or/or.h b/src/or/or.h index 42fd51098b..0a47ea0433 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -5,14 +5,24 @@ #ifndef __OR_H #define __OR_H +#include "orconfig.h" +#undef VERSION + #include #include +#include #include #include #include #include #include +#ifdef HAVE_SYS_POLL_H #include +#elif HAVE_POLL_H +#include +#else +#include "../common/fakepoll.h" +#endif #include #include #include diff --git a/src/smtpap/io.c b/src/smtpap/io.c index 57ea728541..f45e5cf3c8 100644 --- a/src/smtpap/io.c +++ b/src/smtpap/io.c @@ -1,7 +1,8 @@ #include #include #include -#include +#include +#include #include "../common/log.h" #include "../common/utils.h" diff --git a/src/smtpap/smtpap.c b/src/smtpap/smtpap.c index 0e97eaff0e..ae3ad5d1ee 100644 --- a/src/smtpap/smtpap.c +++ b/src/smtpap/smtpap.c @@ -8,6 +8,9 @@ /* * Changes : * $Log$ + * Revision 1.4 2002/09/03 18:44:24 nickm + * Port to MacOS X + * * Revision 1.3 2002/08/24 07:56:34 arma * proxies send port in host order as ascii string * @@ -114,6 +117,7 @@ #include #include #include +#include #include #include #include @@ -122,7 +126,6 @@ #include #include #include -#include #include #include #include