mirror of
				https://github.com/pocoproject/poco.git
				synced 2025-10-30 05:29:41 +01:00 
			
		
		
		
	FTPClientSession::close() error? #1880
This commit is contained in:
		| @@ -181,20 +181,24 @@ void FTPClientSession::logout() | |||||||
| 	{ | 	{ | ||||||
| 		try { endTransfer(); } | 		try { endTransfer(); } | ||||||
| 		catch (...) { } | 		catch (...) { } | ||||||
|  | 		_isLoggedIn = false; | ||||||
| 		std::string response; | 		std::string response; | ||||||
| 		sendCommand("QUIT", response); | 		sendCommand("QUIT", response); | ||||||
| 		_isLoggedIn = false; |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void FTPClientSession::close() | void FTPClientSession::close() | ||||||
| { | { | ||||||
| 	logout(); | 	try { logout(); } | ||||||
|  | 	catch (...) {} | ||||||
|  | 	_serverReady = false; | ||||||
|  | 	if (_pControlSocket) | ||||||
|  | 	{ | ||||||
| 		_pControlSocket->close(); | 		_pControlSocket->close(); | ||||||
| 		delete _pControlSocket; | 		delete _pControlSocket; | ||||||
| 		_pControlSocket = 0; | 		_pControlSocket = 0; | ||||||
| 	_serverReady = false; | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -212,7 +212,7 @@ int WebSocketImpl::receiveNBytes(void* buffer, int bytes) | |||||||
|  |  | ||||||
| int WebSocketImpl::receiveSomeBytes(char* buffer, int bytes) | int WebSocketImpl::receiveSomeBytes(char* buffer, int bytes) | ||||||
| { | { | ||||||
| 	int n = _buffer.size() - _bufferOffset; | 	int n = static_cast<int>(_buffer.size() - _bufferOffset); | ||||||
| 	if (n > 0) | 	if (n > 0) | ||||||
| 	{ | 	{ | ||||||
| 		if (bytes < n) n = bytes; | 		if (bytes < n) n = bytes; | ||||||
|   | |||||||
| @@ -55,7 +55,7 @@ namespace | |||||||
| 				int n; | 				int n; | ||||||
| 				do | 				do | ||||||
| 				{ | 				{ | ||||||
| 					n = ws.receiveFrame(buffer.begin(), buffer.size(), flags); | 					n = ws.receiveFrame(buffer.begin(), static_cast<int>(buffer.size()), flags); | ||||||
| 					ws.sendFrame(buffer.begin(), n, flags); | 					ws.sendFrame(buffer.begin(), n, flags); | ||||||
| 				} | 				} | ||||||
| 				while (n > 0 || (flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE); | 				while (n > 0 || (flags & WebSocket::FRAME_OP_BITMASK) != WebSocket::FRAME_OP_CLOSE); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alex Fabijanic
					Alex Fabijanic