Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
NetWork
Opentracker
提交
0de8b53f
O
Opentracker
项目概览
NetWork
/
Opentracker
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opentracker
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0de8b53f
编写于
10月 21, 2007
作者:
E
erdgeist
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Now the Holzhammer: GET /an is announce, GET /sc is scrape. Period.
上级
6b230701
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
15 deletion
+11
-15
opentracker.c
opentracker.c
+11
-15
未找到文件。
opentracker.c
浏览文件 @
0de8b53f
...
...
@@ -248,6 +248,8 @@ static void httpresponse( const int64 s, char *data, size_t l ) {
* S Y N C *
******************************/
case
4
:
/* sync ? */
if
(
!
byte_diff
(
data
,
2
,
"an"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
2
,
"sc"
)
)
goto
SCRAPE_WORKAROUND
;
if
(
byte_diff
(
data
,
4
,
"sync"
)
)
HTTPERROR_404
;
if
(
NOTBLESSED
(
h
)
)
HTTPERROR_403_IP
;
...
...
@@ -288,6 +290,8 @@ LOG_TO_STDERR( "sync: %d.%d.%d.%d\n", h->ip[0], h->ip[1], h->ip[2], h->ip[3] );
* S T A T S *
******************************/
case
5
:
/* stats ? */
if
(
!
byte_diff
(
data
,
2
,
"an"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
2
,
"sc"
)
)
goto
SCRAPE_WORKAROUND
;
if
(
byte_diff
(
data
,
5
,
"stats"
))
HTTPERROR_404
;
scanon
=
1
;
mode
=
STATS_MRTG
;
...
...
@@ -376,6 +380,7 @@ LOG_TO_STDERR( "stats: %d.%d.%d.%d - mode: s24s old\n", h->ip[0], h->ip[1], h->i
* S C R A P E *
******************************/
case
6
:
/* scrape ? */
if
(
!
byte_diff
(
data
,
2
,
"an"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
byte_diff
(
data
,
6
,
"scrape"
)
)
HTTPERROR_404
;
/* Full scrape... you might want to limit that */
...
...
@@ -429,12 +434,8 @@ SCRAPE_WORKAROUND:
/******************************
* A N N O U N C E *
******************************/
case
7
:
if
(
!
byte_diff
(
data
,
7
,
"announc"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
7
,
"anounce"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
7
,
"annouce"
)
)
goto
ANNOUNCE_WORKAROUND
;
HTTPERROR_404
;
case
8
:
if
(
!
byte_diff
(
data
,
2
,
"sc"
)
)
goto
SCRAPE_WORKAROUND
;
if
(
byte_diff
(
data
,
8
,
"announce"
)
)
HTTPERROR_404
;
ANNOUNCE_WORKAROUND:
...
...
@@ -531,13 +532,9 @@ ANNOUNCE_WORKAROUND:
}
ot_overall_tcp_successfulannounces
++
;
break
;
case
9
:
if
(
!
byte_diff
(
data
,
8
,
"announce"
)
)
goto
ANNOUNCE_WORKAROUND
;
HTTPERROR_404
;
case
10
:
if
(
byte_diff
(
data
,
10
,
"scrape.php"
)
)
HTTPERROR_404
;
goto
SCRAPE_WORKAROUND
;
case
11
:
if
(
!
byte_diff
(
data
,
2
,
"an"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
2
,
"sc"
)
)
goto
SCRAPE_WORKAROUND
;
if
(
byte_diff
(
data
,
11
,
"mrtg_scrape"
)
)
HTTPERROR_404
;
t
=
time
(
NULL
)
-
ot_start_time
;
...
...
@@ -545,10 +542,9 @@ ANNOUNCE_WORKAROUND:
"%llu
\n
%llu
\n
%i seconds (%i hours)
\n
opentracker - Pretuned by german engineers, currently handling %llu connections per second."
,
ot_overall_tcp_connections
+
ot_overall_udp_connections
,
ot_overall_tcp_successfulannounces
+
ot_overall_udp_successfulannounces
,
(
int
)
t
,
(
int
)(
t
/
3600
),
(
ot_overall_tcp_connections
+
ot_overall_udp_connections
)
/
(
(
unsigned
int
)
t
?
(
unsigned
int
)
t
:
1
)
);
break
;
case
12
:
if
(
byte_diff
(
data
,
12
,
"announce.php"
)
)
HTTPERROR_404
;
goto
ANNOUNCE_WORKAROUND
;
default:
/* neither *scrape nor announce */
default:
if
(
!
byte_diff
(
data
,
2
,
"an"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
2
,
"sc"
)
)
goto
SCRAPE_WORKAROUND
;
HTTPERROR_404
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录