Opened at 2010-07-03T11:29:36Z
Closed at 2013-06-16T12:19:28Z
#641 closed defect (fixed)
http_client.c hardly speaks HTTP/1.0
Reported by: | killerbees19 | Owned by: | geert |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | BitlBee | Version: | 1.2.7 |
Keywords: | twitter http localhost dos | Cc: | forum@… |
IRC client+version: | Client-independent | Operating System: | Linux |
OS version/distro: | Debian Lenny |
Description
I have the following problem with BitlBee: Sometimes my DNS returns wrong results. I don't know why, but that's another story and not the primary problem.
Ok, as example: The DNS returns my public server IP and/or localhost as result. BitlBee uses this IP for the Twitter HTTP-Requests. Now BitlBee gets a 301 status (Redirect) from my server, but it can't or won't understand it. Now BitlBee sends more than 50 (!) HTTP-Requests/second to my webserver. Perfect, a mini DoS. There is no end, my webserver logfile was bigger than 4 GB. I had to kill all BitlBee processes, to fix it :-(
Here is a short snippet from the logfile:
188.40.248.*** - - [29/Jun/2010:14:32:20 +0200] "GET /rss.php?mode[blog]=topics&mode[news]=topics&limit=10 HTTP/1.0" 301 320 "-" "-" 188.40.248.*** - - [29/Jun/2010:14:32:22 +0200] "GET /statuses/home_timeline.xml?cursor=-1 HTTP/1.0" 301 267 "-" "BitlBee 1.2.7 Linux/x86_64" 188.40.248.*** - - [29/Jun/2010:14:32:22 +0200] "GET /statuses/home_timeline.xml?cursor=-1 HTTP/1.0" 301 267 "-" "BitlBee 1.2.7 Linux/x86_64" 188.40.248.*** - - [29/Jun/2010:14:32:22 +0200] "GET /statuses/home_timeline.xml?cursor=-1 HTTP/1.0" 301 267 "-" "BitlBee 1.2.7 Linux/x86_64" [...]
You can see, it was no problem for the IRC Bot (1st line; RSS-Feed requested), it got the wrong DNS result too, sent a request to localhost, got a wrong result and ignored it.
But BitlBee tries it again, again and again, ...
Any ideas, patches, ...? thx in advance :-)
Regards, Christian
PS: Sorry for my bad english ;-)
PPS: Yes, this is the official reply to the Twitter messages here:
http://twitter.com/c_schroetter/status/17509357145 | http://twitter.com/BitlBee/status/17519286997 | http://twitter.com/c_schroetter/status/17602742760 | http://twitter.com/c_schroetter/status/17603087510 | http://twitter.com/c_schroetter/status/17604756683
Attachments (0)
Change History (8)
comment:1 Changed at 2010-07-03T21:23:23Z by
comment:2 Changed at 2010-07-15T22:53:43Z by
Alright, I finally took a look at this. Not sure what's going on, I created a 301 page somewhere myself but it won't follow the redirect even *once*.
After some more poking, I noticed that I only implemented handing of absolute redirects. Now I'm also stuck in an infinite loop. Turns out that I never wrote code to avoid infinite redirects. *ouch* :-(
comment:3 follow-up: 4 Changed at 2010-07-15T23:23:51Z by
changeset:devel,610 adds a redirection TTL.
comment:4 Changed at 2010-07-16T07:52:50Z by
Replying to wilmer:
changeset:devel,610 adds a redirection TTL.
The patch looks good, nice work! thx :-)
comment:5 Changed at 2010-07-16T08:04:58Z by
Priority: | critical → normal |
---|
Thanks for the report, also. :-) It's pretty bad that this code didn't have such a simple but important thing for so long. There are some other flaws that need fixing (like parsing the Content-Length: header immediatley), I'll try to work on that too.
That's less important though.
comment:6 Changed at 2010-08-07T16:52:29Z by
Summary: | After DNS-Error: >50 HTTP-Requests to localhost → http_client.c hardly speaks HTTP/1.0 |
---|
comment:7 Changed at 2012-12-06T23:55:22Z by
Component: | Twitter → BitlBee |
---|
comment:8 Changed at 2013-06-16T12:19:28Z by
Resolution: | → fixed |
---|---|
Status: | new → closed |
changeset:devel,991 cleans this up a little bit. Basic HTTP/1.1 support, enough to not get confused anymore when webservers want to do keepalives or chunked encoding.
Hey Chris, thanks a lot for the report!
Not sure why the retries are happening since IIRC I put a limit on the number of redirects the HTTP lib will follow. I'll investigate.