Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
NetWork
Opentracker
提交
886421d2
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,发现更多精彩内容 >>
提交
886421d2
编写于
10月 21, 2007
作者:
E
erdgeist
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Work around more typos that might end up in torrent files as announce urls
上级
2b715b89
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
8 deletion
+16
-8
opentracker.c
opentracker.c
+16
-8
未找到文件。
opentracker.c
浏览文件 @
886421d2
...
...
@@ -390,13 +390,14 @@ write( 2, debug_request, l );
return
sendmmapdata
(
s
,
reply
,
reply_size
);
}
/* This is to hack around stupid clients that just replace
"announce ?info_hash" with "scrape ?info_hash".
We do not want to bomb them with full scrapes */
if
(
!
byte_diff
(
c
,
2
,
" ?"
)
)
c
+=
2
;
SCRAPE_WORKAROUND:
/* This is to hack around stupid clients that send "announce ?info_hash" */
if
(
c
[
-
1
]
!=
'?'
)
{
while
(
(
*
c
!=
'?'
)
&&
(
*
c
!=
'\n'
)
)
++
c
;
if
(
*
c
==
'\n'
)
HTTPERROR_400_PARAM
;
}
scanon
=
1
;
scrape_count
=
0
;
while
(
scanon
)
{
...
...
@@ -429,15 +430,19 @@ SCRAPE_WORKAROUND:
* A N N O U N C E *
******************************/
case
7
:
if
(
byte_diff
(
data
,
7
,
"announc"
)
)
HTTPERROR_404
;
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
7
,
"announc"
)
)
goto
ANNOUNCE_WORKAROUND
;
if
(
!
byte_diff
(
data
,
7
,
"anounce"
)
)
goto
ANNOUNCE_WORKAROUND
;
HTTPERROR_404
;
case
8
:
if
(
byte_diff
(
data
,
8
,
"announce"
)
)
HTTPERROR_404
;
ANNOUNCE_WORKAROUND:
/* This is to hack around stupid clients that send "announce ?info_hash" */
if
(
!
byte_diff
(
c
+
1
,
5
,
"?info"
)
)
c
+=
2
;
if
(
c
[
-
1
]
!=
'?'
)
{
while
(
(
*
c
!=
'?'
)
&&
(
*
c
!=
'\n'
)
)
++
c
;
if
(
*
c
==
'\n'
)
HTTPERROR_400_PARAM
;
}
OT_SETIP
(
&
peer
,
((
struct
http_data
*
)
io_getcookie
(
s
)
)
->
ip
);
OT_SETPORT
(
&
peer
,
&
port
);
...
...
@@ -525,6 +530,9 @@ ANNOUNCE_WORKAROUND:
}
ot_overall_tcp_successfulannounces
++
;
break
;
case
9
:
if
(
byte_diff
(
data
,
9
,
"announce "
)
)
HTTPERROR_404
;
goto
ANNOUNCE_WORKAROUND
;
case
10
:
if
(
byte_diff
(
data
,
10
,
"scrape.php"
)
)
HTTPERROR_404
;
goto
SCRAPE_WORKAROUND
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录