Additional data getting send on QTCPSocket when SOCKS5 proxy is used
The implementation is to send the file to the server using QTcpSockets. I have read the files in buffer and sending it through the active TCP connection. The data is transmitted and the file is sent to the server successfully.
Now, when the data is sent via SOCKS5 proxy, the data is transmitted more than the actual file size corrupting the file on the remote server machine.
To ensure that the data is written on the socket, I have used the QTcpSocket::bytesWritten signal which sends the next chunk of data onto the socket. The proxy is set using QTcpSocket::setProxy.
I have verified that the data read is same as the file size.
Please let me know your valuable comments. Thanks in advance.
Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used
Quote:
Originally Posted by
darshan.hardas
Now, when the data is sent via SOCKS5 proxy, the data is transmitted more than the actual file size corrupting the file on the remote server machine.
Hmm??? Where does the extra data come from?
Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used
I will check but I am fairly sure I am not missing any bytes here. ;)
Darshan: TCP Sockets work like pipes: bytes in one end, the same bytes out the other in the same order. There is no magic. If x+4 bytes are coming out then x+4 bytes are going in. Using QDataStream by any chance?
Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used
We are just using a TCPSockets and not the datastream. The data goes well if the proxy is not involved. But as we set the proxy to the data channel QTcpSocket , additional data is trasmitted.
Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used
Quote:
Originally Posted by
darshan.hardas
additional data is trasmitted.
What additional data?
Try transmitting "this is a test text" text and see what you get on the other end. I'm pretty certain it will be "this is a test text".
Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used
There is no way for us to know on presented information where your alleged extra data is coming from.
Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used
Thanks for all your inputs.. I have to look into the buffer which are used to send the data..