--- bhm.cpp.orig 2012-01-14 12:09:31 UTC +++ bhm.cpp @@ -3,27 +3,25 @@ #endif #include "bhmusers.h" -#include -#include +#include +#include #include #include -#include -#include +#include +#include +#include #include #include #include #include +#ifndef __FreeBSD__ #include +#endif #include "postal.h" #include "logit.h" #include "results.h" #include "basictcp.h" -#ifdef USE_GNUTLS -#include -#include -GCRY_THREAD_OPTION_PTHREAD_IMPL; -#endif int processes = 0; int *thread_status; @@ -47,7 +45,7 @@ void usage(CPCCHAR msg = NULL) int maxMsgSize = 10240; results res; -Logit *log; +Logit *bhm_log; int exitCount = 0; @@ -261,7 +259,7 @@ int readCommand(base_tcp &t, char *buf, int bufSize, b void do_work(thread_data *td) { - base_tcp t(td->fd, log, td->debug, &res + base_tcp t(td->fd, bhm_log, td->debug, &res #ifdef USE_SSL , td->ssl #endif @@ -408,7 +406,7 @@ int main(int argc, char **argv) #endif "\n"); - log = new Logit("bhm.log", allLog, false, 0); + bhm_log = new Logit("bhm.log", allLog, false, 0); Logit *debug = NULL; if(debugName) @@ -419,7 +417,7 @@ int main(int argc, char **argv) in.sin_family = AF_INET; in.sin_port = htons(port); in.sin_addr.s_addr = INADDR_ANY; - if(listen_fd == -1 || bind(listen_fd, (sockaddr *)&in, sizeof(in)) + if(listen_fd == -1 || ::bind(listen_fd, (sockaddr *)&in, sizeof(in)) || listen(listen_fd, 10)) { fprintf(stderr, "Can't bind to port.\n");