Results 1 to 8 of 8

Thread: QHttp "ddosing" website?

  1. #1
    Join Date
    Jun 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QHttp "ddosing" website?

    Hello,

    I'm creating a helper tool for a text-based online browser game.
    Basically, it's loading 10 connections to that game and showing captchas you have to solve. After you send one captcha, it loads next one and so on.
    While it's waiting for you to solve captcha, connection is 'inactive' so there aren't 10 connections active all the time.
    After I started using this tool, I noticed game loading became slow (in normal browser).
    I wasn't exactly sure if it's my fault (because of 10 connections limit I put in program). Few days later, after game continued to be slow, I thought I'd check "netstat" in cmd. There was huge amount of connections to that site (50+), but only few of them were "ESTABLISHED", others were in "TIME_WAIT" state.
    I first thought it's normal and went to check friend's tool (same program, in VB6), but there were only few "ESTABLISHED" and some other connection states, but no 50+ "TIME_WAIT"'s.
    My next guess was that connections weren't closed properly, so I tried to call http->closeConnection(); or http->abort(); after each process (GET or POST), but it didn't help.

    Any ideas?

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

    Default Re: QHttp "ddosing" website?

    We'd have to see some code of yours. But basically TCP connections have a timeout and should naturally die if there is no traffic on the connection within a defined period of time so it shouldn't be the case.
    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
    Jun 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QHttp "ddosing" website?

    I've attached downloading parts. Most of this downloader code isn't mine, I'm a noob so I didn't know how to make simultaneous connections with QHttp, I found some code on internet.

    But basically TCP connections have a timeout and should naturally die if there is no traffic on the connection within a defined period of time so it shouldn't be the case.
    Yeah, I read that before, but this tool is supposed to work with ~300 requests / min, so I'm not sure if they timeout fast enough.
    Attached Files Attached Files

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

    Default Re: QHttp "ddosing" website?

    Well, this isn't compilable so it's hard to check what is going on there. In general I would suggest to replace all that with QNetworkAccessManager which is much easier to use than QHttp.
    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.


  5. #5
    Join Date
    Jun 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QHttp "ddosing" website?

    I thought you're going to read it so I removed unimportant parts. Can I PM you with a whole project, don't want to upload everything here?

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

    Default Re: QHttp "ddosing" website?

    I am not going to read through a whole project. If you want me to work on some code, prepare a minimal compilable example reproducing the problem. Otherwise convert your application to QNetworkAccessManager.
    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.


  7. #7
    Join Date
    Jun 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QHttp "ddosing" website?

    Is QNetworkAccessManager going to fix my problem?
    If not, I have no reason to convert, I get everything I want from QHttp except that problem :/

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

    Default Re: QHttp "ddosing" website?

    Quote Originally Posted by NinoUzi View Post
    Is QNetworkAccessManager going to fix my problem?
    It should or it will at least make it easier to detect and fix the problem. QHttp has some bugs or inconviniences that were fixed by QNetworkAccessManager.
    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.


Similar Threads

  1. new QHttp() Error
    By fengtian.we in forum Qt Programming
    Replies: 7
    Last Post: 6th October 2010, 17:56
  2. problem in using QHttp
    By Ferdous in forum Newbie
    Replies: 4
    Last Post: 10th September 2008, 12:07
  3. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41
  4. QHttp download file problem.
    By fengtian.we in forum Qt Programming
    Replies: 12
    Last Post: 12th June 2007, 09:39
  5. how to use QHttp inside QThread in Qt3
    By alusuel in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2006, 11:19

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
  •  
Qt is a trademark of The Qt Company.