Results 1 to 7 of 7

Thread: Additional data getting send on QTCPSocket when SOCKS5 proxy is used

  1. #1
    Join Date
    Oct 2007
    Posts
    39
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question 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.
    Darshan

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used

    Quote Originally Posted by darshan.hardas View Post
    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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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?

  4. #4
    Join Date
    Oct 2007
    Posts
    39
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default 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.
    Darshan

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Additional data getting send on QTCPSocket when SOCKS5 proxy is used

    Quote Originally Posted by darshan.hardas View Post
    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".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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.

  7. #7
    Join Date
    Oct 2007
    Posts
    39
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default 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..
    Darshan

Similar Threads

  1. Cannot send data with QTcpSocket
    By stef13013 in forum Qt Programming
    Replies: 6
    Last Post: 1st September 2012, 12:00
  2. how to use qtcpsocket send qimage data
    By tsuibin in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2012, 14:51
  3. how to send data using QTcpSocket and QTcpServer
    By gauravg in forum Qt Programming
    Replies: 1
    Last Post: 31st March 2012, 12:29
  4. QTcpSocket does not send data immediately
    By igorosberg in forum Qt Programming
    Replies: 11
    Last Post: 15th July 2011, 15:51
  5. SOCKS5/proxy server in Qt4
    By chukkan in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2009, 08:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.