Sign in to follow this  
Followers 0
SMT

bug in network code

5 posts in this topic

		if(SETTING(OUTGOING_CONNECTIONS) == SettingsManager::OUTGOING_SOCKS5 && proxy) {

				if(udpServer.empty() || udpPort == 0) {

						throw SocketException(STRING(SOCKS_SETUP_ERROR));

				}


				serv_addr.sin_port = htons(udpPort);

				serv_addr.sin_family = AF_INET;

				serv_addr.sin_addr.s_addr = inet_addr(udpServer.c_str());


				string s = BOOLSETTING(SOCKS_RESOLVE) ? resolve(ip) : ip;


				vector<uint8_t> connStr;


				connStr.push_back(0);		   // Reserved

				connStr.push_back(0);		   // Reserved

				connStr.push_back(0);		   // Fragment number, always 0 in our case...


				if(BOOLSETTING(SOCKS_RESOLVE)) {

						connStr.push_back(3);

						connStr.push_back((uint8_t)s.size());

						connStr.insert(connStr.end(), aAddr.begin(), aAddr.end());

				} else {
replace it to
		if(SETTING(OUTGOING_CONNECTIONS) == SettingsManager::OUTGOING_SOCKS5 && proxy) {

				if(udpServer.empty() || udpPort == 0) {

						throw SocketException(STRING(SOCKS_SETUP_ERROR));

				}


				serv_addr.sin_port = htons(udpPort);

				serv_addr.sin_family = AF_INET;

				serv_addr.sin_addr.s_addr = inet_addr(udpServer.c_str());


				// string s = BOOLSETTING(SOCKS_RESOLVE) ? resolve(ip) : ip;


				vector<uint8_t> connStr;


				connStr.push_back(0);		   // Reserved

				connStr.push_back(0);		   // Reserved

				connStr.push_back(0);		   // Fragment number, always 0 in our case...


				if(BOOLSETTING(SOCKS_RESOLVE)) {

						connStr.push_back(3);

						connStr.push_back((uint8_t)aAddr.size());

						connStr.insert(connStr.end(), aAddr.begin(), aAddr.end());

				} else {

Share this post


Link to post
Share on other sites

What is the problem with the code as it is? I wasn't aware of a bug, but i'm always glad of a fix, but what am I fixing?

Share this post


Link to post
Share on other sites

What is the problem with the code as it is? I wasn't aware of a bug, but i'm always glad of a fix, but what am I fixing?

peer can't send search result when working through socks5 proxy

Share this post


Link to post
Share on other sites

Sure this must be moved to 'Bugs' section. Anyway.

Share this post


Link to post
Share on other sites

And fixed upstream if it comes from there ? (StrongDC++ or DC++)

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0