From 72c7569619f58aee7843af9fbf4a50bfc7c0665a Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 26 Sep 2013 23:53:06 +0000 Subject: [PATCH] Fixed compile of libretroshare on Windows. Cleaned some includes of openssl. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6769 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/gxs/rsgenexchange.cc | 5 ----- libretroshare/src/pqi/authgpg.h | 7 ------- libretroshare/src/pqi/authssl.cc | 5 +---- libretroshare/src/pqi/authssl.h | 2 +- libretroshare/src/pqi/pqihash.h | 1 + libretroshare/src/pqi/pqinetwork.h | 5 ----- libretroshare/src/pqi/pqissl.cc | 14 ++++++++++++++ libretroshare/src/pqi/pqissl.h | 8 +++----- libretroshare/src/pqi/pqisslproxy.cc | 8 ++++---- libretroshare/src/pqi/pqisslproxy.h | 2 -- libretroshare/src/pqi/pqissludp.cc | 2 +- libretroshare/src/pqi/pqissludp.h | 2 -- libretroshare/src/pqi/sslfns.h | 1 - libretroshare/src/rsserver/rsinit.cc | 2 ++ libretroshare/src/util/rsnet.h | 9 ++++----- retroshare-gui/src/gui/RetroShareLink.cpp | 1 + 16 files changed, 32 insertions(+), 42 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 5133d79ca..158bd2798 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -26,11 +26,6 @@ #include -#include -#include -#include -#include - #include "pqi/pqihash.h" #include "rsgenexchange.h" #include "gxssecurity.h" diff --git a/libretroshare/src/pqi/authgpg.h b/libretroshare/src/pqi/authgpg.h index 9ee944df5..2f476bd00 100644 --- a/libretroshare/src/pqi/authgpg.h +++ b/libretroshare/src/pqi/authgpg.h @@ -39,14 +39,7 @@ #ifndef RS_GPG_AUTH_HEADER #define RS_GPG_AUTH_HEADER -#include -#include #include "util/rsthreads.h" -//#include "retroshare/rspeers.h" -#include -#include -#include -#include #include "pqi/p3cfgmgr.h" #include "pgp/pgphandler.h" diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc index 7cf8734e0..d8de4e042 100644 --- a/libretroshare/src/pqi/authssl.cc +++ b/libretroshare/src/pqi/authssl.cc @@ -46,11 +46,8 @@ /******************** notify of new Cert **************************/ #include "pqinotify.h" -#include -//#include -//#include #include -#include +#include #include diff --git a/libretroshare/src/pqi/authssl.h b/libretroshare/src/pqi/authssl.h index bf05b1793..efad0b044 100644 --- a/libretroshare/src/pqi/authssl.h +++ b/libretroshare/src/pqi/authssl.h @@ -39,8 +39,8 @@ * */ -#include #include +#include #include #include diff --git a/libretroshare/src/pqi/pqihash.h b/libretroshare/src/pqi/pqihash.h index acf56d290..f545588c9 100644 --- a/libretroshare/src/pqi/pqihash.h +++ b/libretroshare/src/pqi/pqihash.h @@ -29,6 +29,7 @@ #include #include #include +#include #include "util/rsstring.h" #include diff --git a/libretroshare/src/pqi/pqinetwork.h b/libretroshare/src/pqi/pqinetwork.h index 4a48729dc..82198b4ab 100644 --- a/libretroshare/src/pqi/pqinetwork.h +++ b/libretroshare/src/pqi/pqinetwork.h @@ -45,13 +45,8 @@ #else - #include "util/rsnet.h" /* more generic networking header */ -#include -typedef int socklen_t; -//typedef unsigned long in_addr_t; - // Some Network functions that are missing from windows. in_addr_t inet_netof(struct in_addr addr); diff --git a/libretroshare/src/pqi/pqissl.cc b/libretroshare/src/pqi/pqissl.cc index 6f68a543a..46e94c43c 100644 --- a/libretroshare/src/pqi/pqissl.cc +++ b/libretroshare/src/pqi/pqissl.cc @@ -1859,3 +1859,17 @@ std::string pqissl::gethash() /********** End of Implementation of BinInterface ******************/ +int pqissl::net_internal_close(int fd) +{ + return unix_close(fd); +} + +int pqissl::net_internal_SSL_set_fd(SSL *ssl, int fd) +{ + return SSL_set_fd(ssl, fd); +} + +int pqissl::net_internal_fcntl_nonblock(int fd) +{ + return unix_fcntl_nonblock(fd); +} diff --git a/libretroshare/src/pqi/pqissl.h b/libretroshare/src/pqi/pqissl.h index af9068a0a..48717d6ff 100644 --- a/libretroshare/src/pqi/pqissl.h +++ b/libretroshare/src/pqi/pqissl.h @@ -28,8 +28,6 @@ #ifndef MRK_PQI_SSL_HEADER #define MRK_PQI_SSL_HEADER -#include - // operating system specific network header. #include "pqi/pqinetwork.h" @@ -159,9 +157,9 @@ void getCryptoParams(RsPeerCryptoParams& params) ; protected: //protected internal fns that are overloaded for udp case. -virtual int net_internal_close(int fd) { return unix_close(fd); } -virtual int net_internal_SSL_set_fd(SSL *ssl, int fd) { return SSL_set_fd(ssl, fd); } -virtual int net_internal_fcntl_nonblock(int fd) { return unix_fcntl_nonblock(fd);} +virtual int net_internal_close(int fd); +virtual int net_internal_SSL_set_fd(SSL *ssl, int fd); +virtual int net_internal_fcntl_nonblock(int fd); /* data */ diff --git a/libretroshare/src/pqi/pqisslproxy.cc b/libretroshare/src/pqi/pqisslproxy.cc index a450d3cb1..80b9a6b71 100755 --- a/libretroshare/src/pqi/pqisslproxy.cc +++ b/libretroshare/src/pqi/pqisslproxy.cc @@ -168,7 +168,7 @@ int pqisslproxy::Proxy_Send_Method() #endif /* send hello to proxy server */ - uint8_t method_hello_data[3] = { 0x05, 0x01, 0x00 }; // [ Ver | nMethods (1) | No Auth Method ] + char method_hello_data[3] = { 0x05, 0x01, 0x00 }; // [ Ver | nMethods (1) | No Auth Method ] int sent = send(sockfd, method_hello_data, 3, 0); if (sent != 3) @@ -201,7 +201,7 @@ int pqisslproxy::Proxy_Method_Response() /* get response from proxy server */ - uint8_t method_response[2]; + char method_response[2]; // read from the socket. int recvd = recv(sockfd, method_response, 2, MSG_WAITALL); @@ -276,7 +276,7 @@ int pqisslproxy::Proxy_Send_Address() return ret; // Method Response not complete. } - uint8_t socks_request[MAX_SOCKS_REQUEST_LEN] = + char socks_request[MAX_SOCKS_REQUEST_LEN] = { 0x05, // SOCKS VERSION. 0x01, // CONNECT (Tor doesn't support BIND or UDP). 0x00, // RESERVED. @@ -332,7 +332,7 @@ int pqisslproxy::Proxy_Connection_Complete() /* get response from proxy server */ /* response is similar format to request - with variable length data */ - uint8_t socks_response[MAX_SOCKS_REQUEST_LEN]; + char socks_response[MAX_SOCKS_REQUEST_LEN]; int recvd = recv(sockfd, socks_response, 5, MSG_WAITALL); if (recvd != 5) diff --git a/libretroshare/src/pqi/pqisslproxy.h b/libretroshare/src/pqi/pqisslproxy.h index ff1db04a3..f9918832f 100755 --- a/libretroshare/src/pqi/pqisslproxy.h +++ b/libretroshare/src/pqi/pqisslproxy.h @@ -28,8 +28,6 @@ #ifndef MRK_PQI_SSL_PROXY_HEADER #define MRK_PQI_SSL_PROXY_HEADER -#include - // operating system specific network header. #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/pqi/pqissludp.cc b/libretroshare/src/pqi/pqissludp.cc index bf2d8747f..074ef59db 100644 --- a/libretroshare/src/pqi/pqissludp.cc +++ b/libretroshare/src/pqi/pqissludp.cc @@ -30,7 +30,7 @@ #include "tcponudp/bio_tou.h" #include -#include +#include #include "util/rsdebug.h" diff --git a/libretroshare/src/pqi/pqissludp.h b/libretroshare/src/pqi/pqissludp.h index 10498840a..a39128372 100644 --- a/libretroshare/src/pqi/pqissludp.h +++ b/libretroshare/src/pqi/pqissludp.h @@ -28,8 +28,6 @@ #ifndef MRK_PQI_SSL_UDP_HEADER #define MRK_PQI_SSL_UDP_HEADER -#include - // operating system specific network header. #include "pqi/pqinetwork.h" diff --git a/libretroshare/src/pqi/sslfns.h b/libretroshare/src/pqi/sslfns.h index 98e3b2c0e..5015e6772 100644 --- a/libretroshare/src/pqi/sslfns.h +++ b/libretroshare/src/pqi/sslfns.h @@ -35,7 +35,6 @@ #include #include -#include #include #include diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 07f15f774..e00337575 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -60,6 +60,8 @@ // for blocking signals #include +#include + #include "pqi/authssl.h" #include "pqi/sslfns.h" #include "pqi/authgpg.h" diff --git a/libretroshare/src/util/rsnet.h b/libretroshare/src/util/rsnet.h index 01f73a313..5e7802646 100644 --- a/libretroshare/src/util/rsnet.h +++ b/libretroshare/src/util/rsnet.h @@ -44,15 +44,14 @@ #else - -#include - -#include /* for ssize_t */ -//typedef uint32_t socklen_t; +#include typedef uint32_t in_addr_t; int inet_aton(const char *name, struct in_addr *addr); +// Missing defines in MinGW +#define MSG_WAITALL 8 + #endif /********************************** WINDOWS/UNIX SPECIFIC PART ******************/ diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index e5d6630c2..f4b4b494e 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "RetroShareLink.h" #include "MainWindow.h"