Jump to content

web seed encoding bug


k_35

Recommended Posts

I create a torrent:

/testvideo/
/testvideo/1.mkv
/testvideo/中文.mkv
/testvideo/中文 空格.mkv
/testvideo/中文+空格.mkv

I input in "Web Seeds"

http://192.168.0.222/test/video/

Apache log: (uTorrent 3.4 & 3.32)

192.168.0.222 - - [17/Oct/2013:16:06:02 +0800] "GET /test/video/testvideo/\xd6\xd0\xce\xc4%20\xbf\xd5\xb8\xf1.mkv HTTP/1.1" 403 236
192.168.0.222 - - [17/Oct/2013:16:06:02 +0800] "GET /test/video/testvideo/\xd6\xd0\xce\xc4+\xbf\xd5\xb8\xf1.mkv HTTP/1.1" 403 236
192.168.0.222 - - [17/Oct/2013:16:06:02 +0800] "GET /test/video/testvideo/\xd6\xd0\xce\xc4+\xbf\xd5\xb8\xf1.mkv HTTP/1.1" 403 236
192.168.0.222 - - [17/Oct/2013:16:09:22 +0800] "GET /test/video/testvideo/\xd6\xd0\xce\xc4%20\xbf\xd5\xb8\xf1.mkv HTTP/1.1" 403 236
192.168.0.222 - - [17/Oct/2013:16:09:22 +0800] "GET /test/video/testvideo/\xd6\xd0\xce\xc4.mkv HTTP/1.1" 403 231
192.168.0.222 - - [17/Oct/2013:16:09:22 +0800] "GET /test/video/testvideo/1.mkv HTTP/1.1" 206 166350

What's the encoding of the filename? Why not utf8 url encoding ?

Link to comment
Share on other sites

"GET /test/video/testvideo/\xd6\xd0\xce\xc4%20\xbf\xd5\xb8\xf1.mkv HTTP/1.1" 403 23

A HTTP 403 response means Permission Denied so why should it keep trying to access data that IS inaccessible?

Fix that before reporting it as a 'bug'.

Apache return 403 Because uTorrent send WRONG ENCODING.

Link to comment
Share on other sites

Sure it is not because you have a space (%20) in a URI that shouldn't have a space in it?

Other character should be like "%E4%B8%AD%E6%96%87",

just like space to be converted to "%20",

But uTorrent send "\xd6\xd0\xce\xc4", this is not url encoding.

Link to comment
Share on other sites

The filename in URL path is created by uTorrent.

Nope' date=' the filename is the filename on [b']YOUR computer.

Of course not. The filename is utf8 encoding in the .torrent file.

It should be converted to url encoding when utorrent send to apache.

Link to comment
Share on other sites

The filename is utf8 encoding in the .torrent file.

But the 'name' in the metadata data comes DIRECTLY FROM the filename on the drive you have the payload on.

Yes, It's right.

But utorrent shouldn't directly use the filename on the drive.

The filename should be url encoding when utorrent send to the webserver .

Link to comment
Share on other sites

I create another torrent for test.

The directory is "测试视频", 4 multibytes chinese characters.

The filename is "中文.mkv", 2 multibytes chinese characters with extension .mkv.

Apache log:

"\xe6\xb5\x8b\xe8\xaf\x95\xe8\xa7\x86\xe9\xa2\x91/\xd6\xd0\xce\xc4.mkv"

The directory is "\xe6\xb5\x8b\xe8\xaf\x95\xe8\xa7\x86\xe9\xa2\x91", 12 hex chars

The filename is \xd6\xd0\xce\xc4 , 4 hex chars.

So. the root directory is utf8 encoding, every multibytes has 3 bytes,

other files in the directory is GBK encoding, every multibytes has 2bytes.

It's very wrong.

Link to comment
Share on other sites

I see.

I changed the filename in url, apache return 200 now.

"GET /test/video/testvideo/\xe4\xb8\xad\xe6\x96\x87.mkv HTTP/1.0" 200

so the reason is the file's encoding which sent by utorrent is wrong.

The directory's encoding is right.

Link to comment
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...