PDA

View Full Version : QHttp "ddosing" website?



NinoUzi
25th July 2009, 21:55
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?

wysota
25th July 2009, 23:04
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.

NinoUzi
27th July 2009, 15:56
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.

wysota
27th July 2009, 17:25
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.

NinoUzi
28th July 2009, 14:50
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?

wysota
28th July 2009, 14:54
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.

NinoUzi
28th July 2009, 15:04
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 :/

wysota
28th July 2009, 16:23
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.