GithubHelp home page GithubHelp logo

cutehttpfileserver's Introduction

简介

CuteHttpFileServer/chfs是一个免费的、HTTP协议的文件共享服务器,使用浏览器可以快速访问。它具有以下特点:

  • 单个文件,核心功能无需其他文件
  • 跨平台运行,支持主流平台:Windows,Linux和Mac
  • 界面简洁,简单易用
  • 支持扫码下载和手机端访问,手机与电脑之间共享文件非常方便
  • 支持账户权限控制和地址过滤
  • 支持快速分享文字片段
  • 支持webdav协议

与其他常用文件共享方式(如FTP,飞秋,网盘,自己建站)相比,具有使用简单,适用场景更多的优点,在个人使用以及共享给他人的场景中非常方便快捷。

下载

命令行程序

版本更新日志

chfs-linux-386-2.0.zip

chfs-linux-amd64-2.0.zip

chfs-linux-arm-2.0.zip

chfs-linux-arm64-2.0.zip

chfs-linux-mips-2.0.zip

chfs-linux-mips-softfloat-2.0.zip

chfs-linux-mips64-2.0.zip

chfs-linux-mips64-softfloat-2.0.zip

chfs-linux-mips64le-2.0.zip

chfs-linux-mipsle-2.0.zip

chfs-mac-386-2.0.zip

chfs-mac-amd64-2.0.zip

chfs-windows-x64-2.0.zip

chfs-windows-x86-2.0.zip

chfs-支持低版本操作系统(MS XP,OpenBSD 6.0...).zip

GUI程序

gui-chfs-windows.zip

基本用法

非系统服务运行

该程序是一个控制台程序,可直接双击运行,或在控制台/命令行中运行。可通过命令行参数进行相关配置,如使用'chfs --help'来查看帮助:

usage: chfs.exe []

Flags:
  --help              Show context-sensitive help (also try --help-long and
                      --help-man).
  --path=DIRECTORIES  Directories where store shared files, separated by '|'.
  --port=PORT         HTTP listening port(Default is 80).
  --allow=LIST        Allowed IPv4 addresses(Allow any address by default).
                      
                      White list mode: "listitem1[,listitem2,...]" e.g.
                      "192.168.1.2-192.168.1.10,192.169.1.222" allows this 10
                      addresses.
                      
                      Black list mode: "not(listitem1[,listitem2,...])" e.g.
                      "not(192.168.1.2-192.168.1.10,192.169.1.222)" bans this 10
                      addresses!
  --rule=LIST         Access rules(anybody can access any thing by default).
                      
                      List defines like:"USER:PWD:MASK[:DIR:MASK...][|...]":
                      
                        1,USER and PWD is account name and password
                        2,MASK:''=NO present,'r'=read,'w'=write,'d'=delete
                        3,r=view+download,w=r+upload+create+rename,d=w+delete
                        4,DIR is directory name, allows wildcard('*' & '?')
                        5,The 3rd field is access mask of shared root directory
                        6,The optional fields is pairs of sub-directory and mask
                        7,The optional sub-directory's mask overwrite parent's
                        8,You should avoid '|' ':' and white space(exclude DIR)
                      
                      For instance: "::|root:123456:rw" bans guest, and defines
                      a account 'root' can do anything
  --log=DIRECTORY     Log directory. Empty value will disable log.
  --file=FILE         A configuration file which overwrites & enhence the
                      settings.
  --version           Show application version.

参数说明:

help:	显示帮助信息
path:	你要共享的目录,默认为程序运行目录。如果需要共享多个目录,则用“|”符号隔开。注意:如果路径带有空格,则需要将整个路径用引号包住。
port:	程序使用的端口号,默认为80
allow:	IP地址过滤,可使用白名单模式或黑名单模式
rule:	账户及访问权限,允许一个账户多点登陆,默认情况下匿名用户具有读写权限,其语法为:

RULEITEM1[|RULEITEM2|RULEITEM3...]

每个RULEITEM代表一个账户信息及其访问权限,多个RULEITEM则用'|'进行分割,RULEITEM的语法为:

USER:PWD:MASK[:DIR:MASK...]

每个项由“:”来分隔,前三个项是必须的,分别对应:账户名、账户密码、共享目录根目录的访问权限。后面的可选的项,必须成对出现,用来设定根目录下面的子级目录的访问权限。一些规定:

* 对于匿名用户,前两个项都为空
* 访问权限分为四种:""(不可访问),"R"(只读),"W"(读写),"D"(写+删除)。读权限指的是下载,写权限指上传、新建等操作,删除权限是在写权限的基础上加上删除权限。
* 各项的值应避免出现空白键,':''|'(目录名除外)
log:	用户操作日志存放目录,默认是程序所在目录下的logs中。禁用日志功能只需将其赋值为空即可。
file:	配置文件,该文件可配置上述配置项,语法相同,如果配置有效则覆盖对应配置项。另外,一些功能需要通过配置文件进行配置,比如页面自定义和SSL证书设置。下载配置文件模板
version:	显示程序版本号

几个例子:

//都使用默认参数,共享目录为程序运行目录,监听端口号为80
chfs

//共享目录为D盘,监听端口号为8080
chfs --path="d:/" --port=8080

//共享目录为"d:\\projects""e:\\nsis",监听端口号为80
chfs --path="d:\\projects|e:\\nsis"

//白名单模式,允许192.168.1.2-192.168.1.100以及192.168.1.200进行访问
chfs --allow="192.168.1.2-192.168.1.100,192.168.1.200"

//黑名单模式,禁止192.168.1.2-192.168.1.100以及192.168.1.200进行访问
chfs --allow="not(192.168.1.2-192.168.1.100,192.168.1.200)"

//匿名用户具有只读权限(默认情况下匿名用户具有读写权限)
//账户ceshizu,密码为ceshizu123,对根目录的权限为只读,但对test目录具有读写权限
//账户yanfazu,密码为yanfazu123,对根目录的权限为只读,但对yanfa目录具有读写权限
chfs --rule="::r|ceshizu:ceshizu123:r:test:rw|yanfazu:yanfazu123:r:yanfa:rw"

//匿名用户什么权限都没有(默认情况下匿名用户具有读写权限)
//账户admin,密码为admin123,具有读写权限
//账户zhangsan,密码为zhangsan123,对根目录的权限为不可读写,但对zhangsanfiles目录具有读写权限
chfs --rule="::|admin:admin123:rw|zhangsan:zhangsan123::zhangsanfiles:rw"

//通过配置文件进行配置,该文件可以不存在,待以后需要更改配置时使用
chfs --file="d:\chfs\chfs.ini"

Tips 1:在Windows系统中,可以使用右键弹出菜单快捷地共享某个目录。步骤如下:

1, 下载[注册表模板文件](http://iscute.cn/asset/chfs.reg)
2, 在该文件中编辑你的chfs.exe的真实路径,并可添加其他参数
3, 双击该脚本文件,进行注册表添加</pre>

Tips 2:另外,有几个功能需要通过配置文件中进行配置,其中主要的配置项有:

1, html.title: 自定义网页标题
2, html.notice: 自定义网页顶部的公告板。可以是文字,也可以是HTML标签,此时,需要适用一对``(反单引号,通过键盘左上角的ESC键下面的那个键输出)来包住所有HTML标签
3, ssl.cert和ssl.key: 用来配置SSL,启用HTTPS
4, folder.leaf.download: 仅最后一个目录可以打包下载
5, session.timeout: 会话的时长,单位是分钟</pre>

以系统服务运行

本程序不是一个服务程序,所以如果你要以系统服务运行,需要自己创建服务。下面给出Windows平台的创建服务方法(通过NSSM工具):

1, 将chfs.exe放在指定目录,假设为:d:\program\cutehttpfileserver
2, 到[http://www.nssm.cc/download](http://www.nssm.cc/download)下载nssm
3, 将解压后的nssm程序放在d:\program\cutehttpfileserver中
4, 在d:\program\cutehttpfileserver中运行命令行,或运行命令行并CD至该目录
5, 假设你的服务名称为cute_http_file_service,命令行中输入:nssm install cute_http_file_service
6, NSSM会弹出配置对话框,在该对话框中输入程序路径以及运行参数
7, 启动服务,命令行中输入:nssm start cute_http_file_service</pre>

高级用法

如何启用HTTPS?

配置文件中有ssl.cert和ssl.key两个键值,设置好对应的文件目录即可。另外,chfs支持的最低SSL版本为SSLv3,不兼容SSL2的握手。对了,别忘了将监听端口设置为443

我想自己搞一套页面,请问开发文档在哪里?

运行chfs后,通过地址:http://host:port/asset/api.html访问API文档。

如何启用webdav?

程序默认支持webdav,跟http共用同一套访问规则。其地址为:http://host:port/webdav

测试说明

运行主机

  • **Windows XP:**√
  • **Windows 10:**√
  • **Debian 9:**√
  • **CentOS 7:**√
  • **其他:**未测试

PC浏览器

  • **IE:**11+ √
  • **Edge:**√
  • **Firefox:**√
  • **Chrome:**√
  • **Opera:**√
  • **Safari:**√
  • **其他:**未测试

捐助

捐助地址

cutehttpfileserver's People

Contributors

ods-im avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cutehttpfileserver's Issues

对iPad的上传支持

iPad看起来可以上传文件,但是无法浏览其内部文件,可以说,这也就差不多算是不能上传文件
emmm,我觉得可能是iPad OS的安全问题?
背景:win1122h2,运行chfsgui最新版本

ipv6

如果支持ipv6那简直就完美了

windows版无法启动服务

使用windows gui界面应用, 打开页面后, 点击左上角的三角形启动服务,没有任何反应,也没有报错提示

挂载多个目录时,通过webdav协议访问仅能获取第一个目录的内容

cli运行结果:


   CUTE HTTP FILE SERVER 2.0
   website: http://iscute.cn/chfs
   author: [email protected]

此时用RaiDrive或infuse的webdav方式挂载时,仅能显示第一个共享目录的内容(movie目录在E:\for_webdav目录下)。http访问可以显示所有文件夹内容。
image

内存溢出

我在arm 32 的路由器上部署了chfs,正常启动,剩余可用内存不足100M,小文件可以上传,当上传大文件(300M)时出现内存溢出,日志如下,需要怎么处理

fatal error: runtime: out of memory

runtime stack:
runtime.throw(0x54b47e, 0x16)
	c:/go/src/runtime/panic.go:774 +0x5c
runtime.sysMap(0x6400000, 0x4000000, 0x9a3e60)
	c:/go/src/runtime/mem_linux.go:169 +0xa8
runtime.(*linearAlloc).alloc(0x9978a8, 0x4000000, 0x400000, 0x9a3e60, 0x0)
	c:/go/src/runtime/malloc.go:1387 +0x94
runtime.(*mheap).sysAlloc(0x9975b0, 0x4000000, 0x0, 0x0)
	c:/go/src/runtime/malloc.go:607 +0x54
runtime.(*mheap).grow(0x9975b0, 0x2000, 0xffffffff)
	c:/go/src/runtime/mheap.go:1255 +0x84
runtime.(*mheap).allocSpanLocked(0x9975b0, 0x2000, 0x9a3e70, 0x1)
	c:/go/src/runtime/mheap.go:1170 +0x264
runtime.(*mheap).alloc_m(0x9975b0, 0x2000, 0x101, 0x0)
	c:/go/src/runtime/mheap.go:1022 +0xd0
runtime.(*mheap).alloc.func1()
	c:/go/src/runtime/mheap.go:1093 +0x3c
runtime.(*mheap).alloc(0x9975b0, 0x2000, 0x10101, 0x21fc000)
	c:/go/src/runtime/mheap.go:1092 +0x60
runtime.largeAlloc(0x3fffe00, 0x101, 0x21fc2a0)
	c:/go/src/runtime/malloc.go:1138 +0x74
runtime.mallocgc.func1()
	c:/go/src/runtime/malloc.go:1033 +0x38
runtime.systemstack(0x2226000)
	c:/go/src/runtime/asm_arm.s:354 +0x84
runtime.mstart()
	c:/go/src/runtime/proc.go:1146

goroutine 17 [running]:
runtime.systemstack_switch()
	c:/go/src/runtime/asm_arm.s:298 +0x4 fp=0x2069a2c sp=0x2069a28 pc=0x6c014
runtime.mallocgc(0x3fffe00, 0x4c3580, 0x401, 0x0)
	c:/go/src/runtime/malloc.go:1032 +0x8d0 fp=0x2069a94 sp=0x2069a2c pc=0x1b708
runtime.makeslice(0x4c3580, 0x3fffe00, 0x3fffe00, 0x21fa450)
	c:/go/src/runtime/slice.go:49 +0x6c fp=0x2069aa8 sp=0x2069a94 pc=0x55de0
bytes.makeSlice(0x3fffe00, 0x0, 0x0, 0x0)
	c:/go/src/bytes/buffer.go:229 +0x60 fp=0x2069adc sp=0x2069aa8 pc=0x10143c
bytes.(*Buffer).grow(0x20bd0a0, 0x200, 0x5d3)
	c:/go/src/bytes/buffer.go:142 +0x138 fp=0x2069b00 sp=0x2069adc pc=0x100dd4
bytes.(*Buffer).ReadFrom(0x20bd0a0, 0x5ff550, 0x220c2d0, 0xa6ca9178, 0x20bd0a0, 0x1, 0x18)
	c:/go/src/bytes/buffer.go:202 +0x48 fp=0x2069b3c sp=0x2069b00 pc=0x101238
io.copyBuffer(0x5fef50, 0x20bd0a0, 0x5ff550, 0x220c2d0, 0x0, 0x0, 0x0, 0x30, 0x501f78, 0x2017701, ...)
	c:/go/src/io/io.go:388 +0x2fc fp=0x2069b7c sp=0x2069b3c pc=0xafcd0
io.Copy(...)
	c:/go/src/io/io.go:364
io.CopyN(0x5fef50, 0x20bd0a0, 0x5ff5f8, 0x204a500, 0x2000001, 0x0, 0x1, 0x204a4c0, 0x2ebd1c, 0x50e458)
	c:/go/src/io/io.go:340 +0x84 fp=0x2069bac sp=0x2069b7c pc=0xaf83c
mime/multipart.(*Reader).readForm(0x204a4c0, 0x2000000, 0x0, 0x0, 0x0, 0x0)
	c:/go/src/mime/multipart/formdata.go:80 +0x4f8 fp=0x2069c94 sp=0x2069bac pc=0x295c60
mime/multipart.(*Reader).ReadForm(...)
	c:/go/src/mime/multipart/formdata.go:31
net/http.(*Request).ParseMultipartForm(0x2078980, 0x2000000, 0x0, 0x2, 0x220c220)
	c:/go/src/net/http/request.go:1298 +0x80 fp=0x2069d10 sp=0x2069c94 pc=0x2ef78c
net/http.(*Request).FormValue(0x2078980, 0x540628, 0x6, 0x1, 0x0)
	c:/go/src/net/http/request.go:1326 +0x98 fp=0x2069d28 sp=0x2069d10 pc=0x2efc34
main.(*filterRouter).ServeHTTP(0x200f2a8, 0x6037c0, 0x2017320, 0x2078980)
	D:/projects/private/chfs/src/chfs/main.go:357 +0x950 fp=0x2069d9c sp=0x2069d28 pc=0x465730
net/http.serverHandler.ServeHTTP(0x2017e60, 0x6037c0, 0x2017320, 0x2078980)
	c:/go/src/net/http/server.go:2802 +0x88 fp=0x2069db8 sp=0x2069d9c pc=0x2fbbfc
net/http.(*conn).serve(0x21f8000, 0x604420, 0x21f4080)
	c:/go/src/net/http/server.go:1890 +0x7e0 fp=0x2069fdc sp=0x2069db8 pc=0x2f8184
runtime.goexit()
	c:/go/src/runtime/asm_arm.s:868 +0x4 fp=0x2069fdc sp=0x2069fdc pc=0x6dd4c
created by net/http.(*Server).Serve
	c:/go/src/net/http/server.go:2927 +0x2f0

goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0xa6ca9070, 0x72, 0x0)
	c:/go/src/runtime/netpoll.go:184 +0x44
internal/poll.(*pollDesc).wait(0x2062604, 0x72, 0x0, 0x0, 0x54142b)
	c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x30
internal/poll.(*pollDesc).waitRead(...)
	c:/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0x20625f0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	c:/go/src/internal/poll/fd_unix.go:384 +0x1a8
net.(*netFD).accept(0x20625f0, 0x9a2f68, 0x0, 0x1)
	c:/go/src/net/fd_unix.go:238 +0x20
net.(*TCPListener).accept(0x200d010, 0x21f82e0, 0x6eb69b00, 0x49068)
	c:/go/src/net/tcpsock_posix.go:139 +0x20
net.(*TCPListener).Accept(0x200d010, 0x2068e28, 0xc, 0x20000e0, 0x2fc064)
	c:/go/src/net/tcpsock.go:261 +0x3c
net/http.(*Server).Serve(0x2017e60, 0x603660, 0x200d010, 0x0, 0x0)
	c:/go/src/net/http/server.go:2896 +0x220
main.main()
	D:/projects/private/chfs/src/chfs/main.go:189 +0xdc0

goroutine 6 [sync.Cond.Wait]:
runtime.goparkunlock(...)
	c:/go/src/runtime/proc.go:310
sync.runtime_notifyListWait(0x200b1a8, 0x0)
	c:/go/src/runtime/sema.go:510 +0x150
sync.(*Cond).Wait(0x200b1a0)
	c:/go/src/sync/cond.go:56 +0x6c
github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x20729c0, 0x2000000)
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x84
github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x20729c0)
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38
created by github.com/cihub/seelog.NewAsyncLoopLogger
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x6c

goroutine 7 [sync.Cond.Wait]:
runtime.goparkunlock(...)
	c:/go/src/runtime/proc.go:310
sync.runtime_notifyListWait(0x200b348, 0x0)
	c:/go/src/runtime/sema.go:510 +0x150
sync.(*Cond).Wait(0x200b340)
	c:/go/src/sync/cond.go:56 +0x6c
github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x2072a80, 0x0)
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x84
github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x2072a80)
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38
created by github.com/cihub/seelog.NewAsyncLoopLogger
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x6c

goroutine 8 [sync.Cond.Wait]:
runtime.goparkunlock(...)
	c:/go/src/runtime/proc.go:310
sync.runtime_notifyListWait(0x20bcf88, 0x0)
	c:/go/src/runtime/sema.go:510 +0x150
sync.(*Cond).Wait(0x20bcf80)
	c:/go/src/sync/cond.go:56 +0x6c
github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x2073680, 0x0)
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x84
github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x2073680)
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38
created by github.com/cihub/seelog.NewAsyncLoopLogger
	D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x6c

goroutine 9 [sleep]:
runtime.goparkunlock(...)
	c:/go/src/runtime/proc.go:310
time.Sleep(0x85c50000, 0x1a31)
	c:/go/src/runtime/time.go:105 +0x158
main.main.func1()
	D:/projects/private/chfs/src/chfs/main.go:118 +0x28
created by main.main
	D:/projects/private/chfs/src/chfs/main.go:114 +0x76c

goroutine 10 [sleep]:
runtime.goparkunlock(...)
	c:/go/src/runtime/proc.go:310
time.Sleep(0xb2c97000, 0x8b)
	c:/go/src/runtime/time.go:105 +0x158
chfs/preview.PreviewGeneratorDeamon(0x200eee0, 0x1, 0x1)
	D:/projects/private/chfs/src/chfs/preview/preview.go:29 +0x60
created by main.main
	D:/projects/private/chfs/src/chfs/main.go:124 +0x133c

goroutine 27 [IO wait]:
internal/poll.runtime_pollWait(0xa6ca8ddc, 0x72, 0xffffffff)
	c:/go/src/runtime/netpoll.go:184 +0x44
internal/poll.(*pollDesc).wait(0x21f2514, 0x72, 0x1000, 0x1000, 0xffffffff)
	c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x30
internal/poll.(*pollDesc).waitRead(...)
	c:/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0x21f2500, 0x233c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/internal/poll/fd_unix.go:169 +0x178
net.(*netFD).Read(0x21f2500, 0x233c000, 0x1000, 0x1000, 0x394f01, 0x0, 0x2f30ec)
	c:/go/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x21f6a28, 0x233c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/net/net.go:184 +0x58
net/http.(*connReader).Read(0x21f5ce0, 0x233c000, 0x1000, 0x1000, 0x1, 0x0, 0x8)
	c:/go/src/net/http/server.go:785 +0x15c
bufio.(*Reader).fill(0x21fa4e0)
	c:/go/src/bufio/bufio.go:100 +0x108
bufio.(*Reader).ReadSlice(0x21fa4e0, 0x529d0a, 0x1, 0xd0412, 0x21f2500, 0x0, 0x80)
	c:/go/src/bufio/bufio.go:359 +0x2c
bufio.(*Reader).ReadLine(0x21fa4e0, 0x2342c10, 0x992798, 0xb6f2436c, 0x0, 0x2208280, 0x1)
	c:/go/src/bufio/bufio.go:388 +0x24
net/textproto.(*Reader).readLineSlice(0x21f5d20, 0x2216980, 0x2342e58, 0x21f2500, 0x60368, 0xc7718)
	c:/go/src/net/textproto/reader.go:57 +0x54
net/textproto.(*Reader).ReadLine(...)
	c:/go/src/net/textproto/reader.go:38
net/http.readRequest(0x21fa4e0, 0x0, 0x2216980, 0x0, 0x0)
	c:/go/src/net/http/request.go:1012 +0x5c
net/http.(*conn).readRequest(0x21f8240, 0x604420, 0x21f5cc0, 0x0, 0x0, 0x0)
	c:/go/src/net/http/server.go:965 +0x1c8
net/http.(*conn).serve(0x21f8240, 0x604420, 0x21f5cc0)
	c:/go/src/net/http/server.go:1817 +0x644
created by net/http.(*Server).Serve
	c:/go/src/net/http/server.go:2927 +0x2f0

goroutine 44 [IO wait]:
internal/poll.runtime_pollWait(0xa6ca8c50, 0x72, 0xffffffff)
	c:/go/src/runtime/netpoll.go:184 +0x44
internal/poll.(*pollDesc).wait(0x21f2424, 0x72, 0x1000, 0x1000, 0xffffffff)
	c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x30
internal/poll.(*pollDesc).waitRead(...)
	c:/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0x21f2410, 0x210c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/internal/poll/fd_unix.go:169 +0x178
net.(*netFD).Read(0x21f2410, 0x210c000, 0x1000, 0x1000, 0x2202d48, 0x6b054, 0x21be000)
	c:/go/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x200f040, 0x210c000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/net/net.go:184 +0x58
net/http.(*persistConn).Read(0x20c6000, 0x210c000, 0x1000, 0x1000, 0x2020840, 0x30f340, 0x2020840)
	c:/go/src/net/http/transport.go:1752 +0x164
bufio.(*Reader).fill(0x21fa360)
	c:/go/src/bufio/bufio.go:100 +0x108
bufio.(*Reader).Peek(0x21fa360, 0x1, 0x0, 0x0, 0x1, 0x2020700, 0x0)
	c:/go/src/bufio/bufio.go:138 +0x38
net/http.(*persistConn).readLoop(0x20c6000)
	c:/go/src/net/http/transport.go:1905 +0x178
created by net/http.(*Transport).dialConn
	c:/go/src/net/http/transport.go:1574 +0x8e8

goroutine 21 [IO wait]:
internal/poll.runtime_pollWait(0xa6ca8f68, 0x72, 0xffffffff)
	c:/go/src/runtime/netpoll.go:184 +0x44
internal/poll.(*pollDesc).wait(0x21f2294, 0x72, 0x1000, 0x1000, 0xffffffff)
	c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x30
internal/poll.(*pollDesc).waitRead(...)
	c:/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0x21f2280, 0x22dc000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/internal/poll/fd_unix.go:169 +0x178
net.(*netFD).Read(0x21f2280, 0x22dc000, 0x1000, 0x1000, 0x394f01, 0x0, 0x2f30ec)
	c:/go/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x21f6950, 0x22dc000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/net/net.go:184 +0x58
net/http.(*connReader).Read(0x21f55a0, 0x22dc000, 0x1000, 0x1000, 0x1, 0x0, 0x8)
	c:/go/src/net/http/server.go:785 +0x15c
bufio.(*Reader).fill(0x21fa300)
	c:/go/src/bufio/bufio.go:100 +0x108
bufio.(*Reader).ReadSlice(0x21fa300, 0x529d0a, 0x1, 0xd0412, 0x21f2200, 0x0, 0x80)
	c:/go/src/bufio/bufio.go:359 +0x2c
bufio.(*Reader).ReadLine(0x21fa300, 0x2065c10, 0x2226000, 0xb6f2436c, 0x0, 0x2208280, 0x1)
	c:/go/src/bufio/bufio.go:388 +0x24
net/textproto.(*Reader).readLineSlice(0x21f55e0, 0x2216900, 0x2065e58, 0x21f2280, 0x60368, 0xc7718)
	c:/go/src/net/textproto/reader.go:57 +0x54
net/textproto.(*Reader).ReadLine(...)
	c:/go/src/net/textproto/reader.go:38
net/http.readRequest(0x21fa300, 0x0, 0x2216900, 0x0, 0x0)
	c:/go/src/net/http/request.go:1012 +0x5c
net/http.(*conn).readRequest(0x21f80c0, 0x604420, 0x21f5580, 0x0, 0x0, 0x0)
	c:/go/src/net/http/server.go:965 +0x1c8
net/http.(*conn).serve(0x21f80c0, 0x604420, 0x21f5580)
	c:/go/src/net/http/server.go:1817 +0x644
created by net/http.(*Server).Serve
	c:/go/src/net/http/server.go:2927 +0x2f0

goroutine 22 [IO wait]:
internal/poll.runtime_pollWait(0xa6ca8ee4, 0x72, 0xffffffff)
	c:/go/src/runtime/netpoll.go:184 +0x44
internal/poll.(*pollDesc).wait(0x21f22e4, 0x72, 0x1000, 0x1000, 0xffffffff)
	c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x30
internal/poll.(*pollDesc).waitRead(...)
	c:/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0x21f22d0, 0x22ee000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/internal/poll/fd_unix.go:169 +0x178
net.(*netFD).Read(0x21f22d0, 0x22ee000, 0x1000, 0x1000, 0x394f01, 0x0, 0x2f30ec)
	c:/go/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x21f6958, 0x22ee000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/net/net.go:184 +0x58
net/http.(*connReader).Read(0x21f57e0, 0x22ee000, 0x1000, 0x1000, 0x1, 0x0, 0x8)
	c:/go/src/net/http/server.go:785 +0x15c
bufio.(*Reader).fill(0x21fa390)
	c:/go/src/bufio/bufio.go:100 +0x108
bufio.(*Reader).ReadSlice(0x21fa390, 0x529d0a, 0x1, 0xd0412, 0x21f2200, 0x0, 0x80)
	c:/go/src/bufio/bufio.go:359 +0x2c
bufio.(*Reader).ReadLine(0x21fa390, 0x2233c10, 0x2226000, 0xb6f2436c, 0x0, 0x20b8280, 0x1)
	c:/go/src/bufio/bufio.go:388 +0x24
net/textproto.(*Reader).readLineSlice(0x200a100, 0x2174080, 0x2233e58, 0x21f22d0, 0x60368, 0xc7718)
	c:/go/src/net/textproto/reader.go:57 +0x54
net/textproto.(*Reader).ReadLine(...)
	c:/go/src/net/textproto/reader.go:38
net/http.readRequest(0x21fa390, 0x0, 0x2174080, 0x0, 0x0)
	c:/go/src/net/http/request.go:1012 +0x5c
net/http.(*conn).readRequest(0x21f8120, 0x604420, 0x21f57c0, 0x0, 0x0, 0x0)
	c:/go/src/net/http/server.go:965 +0x1c8
net/http.(*conn).serve(0x21f8120, 0x604420, 0x21f57c0)
	c:/go/src/net/http/server.go:1817 +0x644
created by net/http.(*Server).Serve
	c:/go/src/net/http/server.go:2927 +0x2f0

goroutine 23 [IO wait]:
internal/poll.runtime_pollWait(0xa6ca8e60, 0x72, 0xffffffff)
	c:/go/src/runtime/netpoll.go:184 +0x44
internal/poll.(*pollDesc).wait(0x21f2334, 0x72, 0x1000, 0x1000, 0xffffffff)
	c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x30
internal/poll.(*pollDesc).waitRead(...)
	c:/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0x21f2320, 0x22da000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/internal/poll/fd_unix.go:169 +0x178
net.(*netFD).Read(0x21f2320, 0x22da000, 0x1000, 0x1000, 0x394f01, 0x0, 0x2f30ec)
	c:/go/src/net/fd_unix.go:202 +0x38
net.(*conn).Read(0x21f6960, 0x22da000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
	c:/go/src/net/net.go:184 +0x58
net/http.(*connReader).Read(0x21f5500, 0x22da000, 0x1000, 0x1000, 0x1, 0x0, 0x8)
	c:/go/src/net/http/server.go:785 +0x15c
bufio.(*Reader).fill(0x21fa2d0)
	c:/go/src/bufio/bufio.go:100 +0x108
bufio.(*Reader).ReadSlice(0x21fa2d0, 0x529d0a, 0x1, 0xd0412, 0x21f2300, 0x0, 0x80)
	c:/go/src/bufio/bufio.go:359 +0x2c
bufio.(*Reader).ReadLine(0x21fa2d0, 0x2064c10, 0x992798, 0xb6f24008, 0x0, 0x2208200, 0x0)
	c:/go/src/bufio/bufio.go:388 +0x24
net/textproto.(*Reader).readLineSlice(0x21f4100, 0x2174a00, 0x2064e58, 0x21f2320, 0x60368, 0xc7718)
	c:/go/src/net/textproto/reader.go:57 +0x54
net/textproto.(*Reader).ReadLine(...)
	c:/go/src/net/textproto/reader.go:38
net/http.readRequest(0x21fa2d0, 0x0, 0x2174a00, 0x0, 0x0)
	c:/go/src/net/http/request.go:1012 +0x5c
net/http.(*conn).readRequest(0x21f8180, 0x604420, 0x21f54e0, 0x0, 0x0, 0x0)
	c:/go/src/net/http/server.go:965 +0x1c8
net/http.(*conn).serve(0x21f8180, 0x604420, 0x21f54e0)
	c:/go/src/net/http/server.go:1817 +0x644
created by net/http.(*Server).Serve
	c:/go/src/net/http/server.go:2927 +0x2f0

goroutine 28 [IO wait]:
internal/poll.runtime_pollWait(0xa6ca8d58, 0x72, 0xffffffff)
	c:/go/src/runtime/netpoll.go:184 +0x44

安全性问题

可以通过http://192.168.3.2/#/123/../.. 这样的方式访问到根目录的上层文件夹,相当于将系统文件全部暴露,只是无法下载,但是仍可查看目录文件名等信息

报错:runtime: out of memory: cannot allocate

runtime: out of memory: cannot allocate
343932928-byte block (956137472 in use) fatal error: out of memory
runtime stack:
runtime.throw(0x902ae2, 0xd) c:/go/src/runtime/panic.go:774 +0x64 runtime.largeAlloc(0x147ff400, 0x440101, 0x47000000) c:/go/src/runtime/malloc.go:1140 +0x108 runtime.mallocgc.func1() c:/go/src/runtime/malloc.go
:1033 +0x39 runtime.systemstack(0x44fcb2) c:/go/src/runtime/asm_386.s:399 +0x53 runtime.mstart() c:/go/src/runtime/proc.go:1146 goroutine 10 [running]: runtime.systemstack_switch() c:/go/src/runtime/asm_386.s:360 fp=0x119a1830 sp=0x119a182c pc=0x44fd60 runtime.mallocgc(0x147ff400, 0x880180, 0x1, 0x47000000) c:/go/src/runtime/malloc.go:1032 +0x684 fp=0x119a1884 sp=0x119a1830 pc=0x40a454 runtime.makeslice(0x880180, 0x147ff4, 0x147ff4, 0x47000000) c:/go/src/runtime/slice.go:49 +0x4f fp=0x119a1898 sp=0x119a1884 pc=0x43c85f image/jpeg.(*decoder).processSOS(0x11bb4000, 0xa, 0x2, 0x80) c:/go/src/image/jpeg/scan.go:156 +0x57f fp=0x119a1a78 sp=0x119a1898 pc=0x5e0d0f image/jpeg.(*decoder).decode(0x11bb4000, 0x9b4850, 0x118445d0, 0x408100, 0x88c0c0, 0x8e86c0, 0x924b00, 0x9b4850) c:/go/src/image/jpeg/reader.go:630 +0x29c fp=0x119a1a9c sp=0x119a1a78 pc=0x5df2cc image/jpeg.Decode(0x9b4850, 0x118445d0, 0x118445d0, 0x9b4850, 0x118445d0, 0x2) c:/go/src/image/jpeg/reader.go:779 +0x44 fp=0x119a1ac0 sp=0x119a1a9c pc=0x5e00f4 image.Decode(0x9b5630,
0x11ae1860, 0x11ae1860, 0x9b5630, 0x11ae1860, 0x0, 0x0, 0x457cf3) c:/go/src/image/format.go:93 +0xb1 fp=0x119a1b3c sp=0x119a1ac0 pc=0x5cdbb1 github.com/disintegration/imaging.Decode(...) D:/projects/private/chfs/src/github.com/disintegration/imaging/helpers.go:89 github.com/disintegration/imaging.Open(0x11b93180, 0x4a, 0x0, 0x0, 0x0, 0x0) D:/projects/private/chfs/src/github.com/disintegration/imaging/helpers.go:100 +0xd4 fp=0x119a1b90 sp=0x119a1b3c pc=0x5fa424 chfs/preview/imagepreview.GetPreviewImage(0x11b93180, 0x4a, 0x40, 0x40) D:/projects/private/chfs/src/chfs/preview/imagepreview/image.go:41 +0x2d fp=0x119a1bc8 sp=0x119a1b90 pc=0x5ffb5d chfs/preview.generate.func1(0x11b93180, 0x4a, 0x9bd5e0, 0x11b9e4e0, 0x0, 0x0, 0x457cf3, 0xd3ade0) D:/projects/private/chfs/src/chfs/preview/preview.go:62 +0x109 fp=0x119a1c08 sp=0x119a1bc8 pc=0x756789 path/filepath.walk(0x11b93180, 0x4a, 0x9bd5e0, 0x11b9e4e0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:358 +0x2dd fp=0x119a1c6c sp=0x119a1c08 pc=0x5bf96d path/filepath.walk(0x11b7f080, 0x40, 0x9bd5e0, 0x11b8b680, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1cd0 sp=0x119a1c6c pc=0x5bf889 path/filepath.walk(0x11b7ef40, 0x3d, 0x9bd5e0, 0x11b8b500, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1d34 sp=0x119a1cd0 pc=0x5bf889 path/filepath.walk(0x11ad6880, 0x38, 0x9bd5e0, 0x11b129c0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1d98 sp=0x119a1d34 pc=0x5bf889 path/filepath.walk(0x11ac1440, 0x2e, 0x9bd5e0, 0x11a32b40, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1dfc sp=0x119a1d98 pc=0x5bf889 path/filepath.walk(0x11ac1140, 0x28, 0x9bd5e0, 0x11a32000, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1e60 sp=0x119a1dfc pc=0x5bf889 path/filepath.walk(0x11ac0a20, 0x22, 0x9bd5e0, 0x11a2aae0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1ec4 sp=0x119a1e60 pc=0x5bf889 path/filepath.walk(0x11afcb20, 0x18, 0x9bd5e0, 0x11aff0e0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1f28 sp=0x119a1ec4 pc=0x5bf889 path/filepath.walk(0x11816940, 0xf, 0x9bd5e0, 0x1184fbc0, 0x924650, 0x0, 0x11827dc0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x119a1f8c sp=0x119a1f28 pc=0x5bf889 path/filepath.Walk(0x11816940, 0xf, 0x924650, 0xd3d2c0, 0xd3d2c0) c:/go/src/path/filepath/path.go:404 +0xdd fp=0x119a1fb8 sp=0x119a1f8c pc=0x5bfa6d chfs/preview.generate(0x11816940, 0xf) D:/projects/private/chfs/src/chfs/preview/preview.go:58 +0x33 fp=0x119a1fd0 sp=0x119a1fb8 pc=0x756673 chfs/preview.PreviewGeneratorDeamon(0x11806e98, 0x1, 0x1) D:/projects/private/chfs/src/chfs/preview/preview.go:23 +0x33 fp=0x119a1fe0 sp=0x119a1fd0 pc=0x756333 runtime.goexit() c:/go/src/runtime/asm_386.s:1325 +0x1 fp=0x119a1fe4 sp=0x119a1fe0 pc=0x451671 created by main.main D:/projects/private/chfs/src/chfs/main.go:124 +0x13f0 goroutine 1 [IO wait]: internal/poll.runtime_pollWait(0x31a85070, 0x72, 0x9b6530) c:/go/src/runtime/netpoll.go:184 +0x4b internal/poll.(*pollDesc).wait(0x1186943c, 0x72, 0xc98600, 0x0, 0x0) c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x37 internal/poll.(*ioSrv).ExecIO(0xd3a214, 0x11869354, 0x11990060, 0x17, 0x1, 0x0) c:/go/src/internal/poll/fd_windows.go:228 +0xef internal/poll.(*FD).acceptOne(0x11869340, 0x270, 0x119ae000, 0x2, 0x2, 0x11869354, 0xf, 0x1c, 0x0, 0x46) c:/go/src/internal/poll/fd_windows.go:896 +0x82 internal/poll.(*FD).Accept(0x11869340, 0x11959dc8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) c:/go/src/internal/poll/fd_windows.go:930 +0x12e net.(*netFD).accept(0x11869340, 0x0, 0xd3bcc0, 0x0) c:/go/src/net/fd_windows.go:193 +0x66 net.(*TCPListener).accept(0x11804d60, 0x119ac040, 0x4f5ce000, 0x43383d) c:/go/src/net/tcpsock_posix.go:139 +0x27 net.(*TCPListener).Accept(0x11804d60, 0x11867e30, 0xc, 0x11826000, 0x6b54a1) c:/go/src/net/tcpsock.go:261 +0x3c net/http.(*Server).Serve(0x11855710, 0x9ba330, 0x11804d60, 0x0, 0x0) c:/go/src/net/http/server.go:2896 +0x22f main.main() D:/projects/private/chfs/src/chfs/main.go:189 +0xf58 goroutine 6 [sync.Cond.Wait]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 sync.runtime_notifyListWait(0x1189c908, 0x0) c:/go/src/runtime/sema.go:510 +0x121 sync.(*Cond).Wait(0x1189c900) c:/go/src/sync/cond.go:56 +0x66 github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x1184eae0, 0x0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x74 github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x1184eae0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38 created by github.com/cihub/seelog.NewAsyncLoopLogger D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x72 goroutine 7 [sync.Cond.Wait]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 sync.runtime_notifyListWait(0x1189caa8, 0x0) c:/go/src/runtime/sema.go:510 +0x121 sync.(*Cond).Wait(0x1189caa0) c:/go/src/sync/cond.go:56 +0x66 github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x1184eba0, 0x0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x74 github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x1184eba0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38 created by github.com/cihub/seelog.NewAsyncLoopLogger D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x72 goroutine 8 [sync.Cond.Wait]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 sync.runtime_notifyListWait(0x118c06a8, 0x0) c:/go/src/runtime/sema.go:510 +0x121 sync.(*Cond).Wait(0x118c06a0) c:/go/src/sync/cond.go:56 +0x66 github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x1184f920, 0x0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x74 github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x1184f920) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38 created by github.com/cihub/seelog.NewAsyncLoopLogger D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x72 goroutine 9 [sleep]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 time.Sleep(0x85c50000, 0x1a31) c:/go/src/runtime/time.go:105 +0x159 main.main.func1() D:/projects/private/chfs/src/chfs/main.go:118 +0x2b created by main.main D:/projects/private/chfs/src/chfs/main.go:114 +0x888 goroutine 37 [IO wait]: internal/poll.runtime_pollWait(0x31a84f68, 0x77, 0x9b6530) c:/go/src/runtime/netpoll.go:184 +0x4b internal/poll.(*pollDesc).wait(0x119aa0fc, 0x77, 0xc98600, 0x0, 0x0) c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x37 internal/poll.(*ioSrv).ExecIO(0xd3a218, 0x119aa088, 0x924be0, 0x1, 0x2dca0000, 0x0) c:/go/src/internal/poll/fd_windows.go:228 +0xef internal/poll.SendFile(0x119aa000, 0x278, 0x4695b8b, 0x0, 0x0, 0x0, 0x0, 0x0) c:/go/src/internal/poll/sendfile_windows.go:34 +0x128 net.sendFile(0x119aa000, 0x9b50b0, 0x11ae4e40, 0x119ac000, 0x119b1000, 0x13e, 0x1000, 0x13e) c:/go/src/net/sendfile_windows.go:38 +0xa2 net.(*TCPConn).readFrom(0x11948048, 0x9b50b0, 0x11ae4e40, 0x8000104, 0x0, 0xffffffff, 0x6ab9f0) c:/go/src/net/tcpsock_posix.go:51 +0x37 net.(*TCPConn).ReadFrom(0x11948048, 0x9b50b0, 0x11ae4e40, 0xc, 0x118507fc, 0x407601, 0x11808000) c:/go/src/net/tcpsock.go:103 +0x3f net/http.(*response).ReadFrom(0x11855950, 0x9b50b0, 0x11ae4e40, 0x0, 0x0, 0x0, 0x0) c:/go/src/net/http/server.go:603 +0x252 io.copyBuffer(0x9b5530, 0x11855950, 0x9b50b0, 0x11ae4e40, 0x0, 0x0, 0x0, 0x408199, 0x88c300, 0x8e7bc0, ...) c:/go/src/io/io.go:388 +0x29e io.Copy(...) c:/go/src/io/io.go:364 io.CopyN(0x9b5530, 0x11855950, 0x9b5630, 0x118074c8, 0x4695b8b, 0x0, 0x23, 0x0, 0x0, 0x11811430) c:/go/src/io/io.go:340 +0x8e net/http.serveContent(0x9ba470, 0x11855950, 0x1187ac00, 0x11818877, 0x3d, 0x34249af8, 0x0, 0xdbe050fb, 0xe, 0xd3bcc0, ...) c:/go/src/net/http/fs.go:298 +0x21f net/http.ServeContent(0x9ba470, 0x11855950, 0x1187ac00, 0x11818877, 0x3d, 0x34249af8, 0x0, 0xdbe050fb, 0xe, 0xd3bcc0, ...) c:/go/src/net/http/fs.go:165 +0x98 golang.org/x/net/webdav.(*Handler).handleGetHeadPost(0x118c17e0, 0x9ba470, 0x11855950, 0x1187ac00, 0xc8
, 0x0, 0x0) D:/projects/private/chfs/src/golang.org/x/net/webdav/webdav.go:219 +0x39c golang.org/x/net/webdav.(*Handler).ServeHTTP(0x118c17e0, 0x9ba470, 0x11855950, 0x1187ac00) D:/projects/private/chfs/src/golang.org/x/net/webdav/webdav.go:53 +0xa2 main.webdavHandler(0x9ba470, 0x11855950, 0x1187ac00) D:/projects/private/chfs/src/chfs/mywebdav.go:81 +0x3cb main.(*filterRouter).ServeHTTP(0x118071f8, 0x9ba470, 0x11855950, 0x1187ac00) D:/projects/private/chfs/src/chfs/main.go:277 +0xf47 net/http.serverHandler.ServeHTTP(0x11855710, 0x9ba470, 0x11855950, 0x1187ac00) c:/go/src/net/http/server.go:2802 +0x84 net/http.(*conn).serve(0x119ac000, 0x9bb000, 0x118c1be0) c:/go/src/net/http/server.go:1890 +0x7ad created by net/http.(*Server).Serve c:/go/src/net/http/server.go:2927 +0x311 goroutine 51 [IO wait]: internal/poll.runtime_pollWait(0x31a84f68, 0x72, 0x9b6530) c:/go/src/runtime/netpoll.go:184 +0x4b internal/poll.(*pollDesc).wait(0x119aa0fc, 0x72, 0xc98600, 0x0, 0x0) c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x37 internal/poll.(*ioSrv).ExecIO(0xd3a214, 0x119aa014, 0x924bac, 0x0, 0x1193dea4, 0x56cfcb) c:/go/src/internal/poll/fd_windows.go:228 +0xef internal/poll.(*FD).Read(0x119aa000, 0x118c1c0d, 0x1, 0x1, 0x0, 0x0, 0x0) c:/go/src/internal/poll/fd_windows.go:527 +0x10a net.(*netFD).Read(0x119aa000, 0x118c1c0d, 0x1, 0x1, 0x1183d800, 0x1193dfd0, 0x1) c:/go/src/net/fd_windows.go:152 +0x3f net.(*conn).Read(0x11948048, 0x118c1c0d, 0x1, 0x1, 0x0, 0x0, 0x0) c:/go/src/net/net.go:184 +0x56 net/http.(*connReader).backgroundRead(0x118c1c00) c:/go/src/net/http/server.go:677 +0x46 created by net/http.(*connReader).startBackgroundRead c:/go/src/net/http/server.go:673 +0xae goroutine 35 [IO wait]: internal/poll.runtime_pollWait(0x31a84fec, 0x72, 0x9b6530) c:/go/src/runtime/netpoll.go:184 +0x4b internal/poll.(*pollDesc).wait(0x1186959c, 0x72, 0xc98600, 0x0, 0x0) c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x37 internal/poll.(*ioSrv).ExecIO(0xd3a214, 0x118694b4, 0x924bac, 0x0, 0x6c1df1, 0xd35d20) c:/go/src/internal/poll/fd_windows.go:228 +0xef internal/poll.(*FD).Read(0x118694a0, 0x11994000, 0x1000, 0x1000, 0x0, 0x0, 0x0) c:/go/src/internal/poll/fd_windows.go:527 +0x10a net.(*netFD).Read(0x118694a0, 0x11994000, 0x1000, 0x1000, 0x11833d48, 0x44ef50, 0x11827ce0) c:/go/src/net/fd_windows.go:152 +0x3f net.(*conn).Read(0x11948008, 0x11994000, 0x1000, 0x1000, 0x0, 0x0, 0x0) c:/go/src/net/net.go:184 +0x56 net/http.(*persistConn).Read(0x118881e0, 0x11994000, 0x1000, 0x1000, 0x11998080, 0x404134, 0x11998080) c:/go/src/net/http/transport.go:1752 +0x143 bufio.(*Reader).fill(0x11944030) c:/go/src/bufio/bufio.go:100 +0xe9 bufio.(*Reader).Peek(0x11944030, 0x1, 0x0, 0x0, 0x1, 0x11998000, 0x0) c:/go/src/bufio/bufio.go:138 +0x41 net/http.(*persistConn).readLoop(0x118881e0) c:/go/src/net/http/transport.go:1905 +0x1c0 created by net/http.(*Transport).dialConn c:/go/src/net/http/transport.go:1574 +0x8fe goroutine 36 [select]: net/http.(*persistConn).writeLoop(0x118881e0) c:/go/src/net/http/transport.go:2204 +0xef created by net/http.(*Transport).dialConn c:/go/src/net/http/transport.go:1575 +0x91f

内存溢出,16G内存,使用率36%,启动约5分钟,直接报错网站停止运行

website:http://192.168.1.35/
webdav :http://192.168.1.35/webdav
runtime: out of memory: cannot allocate
1183981568-byte block (8224768 in use) fatal error: out of memory
runtime stack:
runtime.throw(0x902ae2, 0xd) c:/go/src/runtime/panic.go:774 +0x64 runtime.largeAlloc(0x46921800, 0x890101, 0x321b1fc8) c:/go/src/runtime/malloc.go:1140 +0x108 runtime.mallocgc.func1() c:/go/src/runtime/malloc.go:1033 +0x39 runtime.systemstack(0x0)
c:/go/src/runtime/asm_386.s:399 +0x53 runtime.mstart() c:/go/src/runtime/proc.go:1146 goroutine 23 [running]: runtime.systemstack_switch() c:/go/src/runtime/asm_386.s:360 fp=0x1183b89c sp=0x1183b898 pc=0x44fd60 runtime.mallocgc(0x46921800, 0x878420, 0x1, 0x433290) c:/go/src/runtime/malloc.go:1032 +0x684 fp=0x1183b8f0 sp=0x1183b89c pc=0x40a454 runtime.makeslice(0x878420, 0x46921800, 0x46921800, 0x5310) c:/go/src/runtime/slice.go:49 +0x4f fp=0x1183b904 sp=0x1183b8f0 pc=0x43c85f image.NewYCbCr(0x0, 0x0, 0x4880, 0x5310, 0x0, 0x756834c0) c:/go/src/image/ycbcr.go:174 +0x89 fp=0x1183b950 sp=0x1183b904 pc=0x5d3279 image/jpeg.(*decoder).makeImg(0x11c94000, 0x910, 0xa62) c:/go/src/image/jpeg/scan.go:40 +0x224 fp=0x1183b9c4 sp=0x1183b950 pc=0x5e05a4 image/jpeg.(*decoder).processSOS(0x11c94000, 0xa, 0x2, 0x80) c:/go/src/image/jpeg/scan.go:150 +0xf71 fp=0x1183bba4 sp=0x1183b9c4 pc=0x5e1701 image/jpeg.(*decoder).decode(0x11c94000, 0x9b4850, 0x11918030, 0x408100, 0x88c0c0, 0x8e86c0, 0x924b00, 0x9b4850) c:/go/src/image/jpeg/reader.go:630 +0x29c fp=0x1183bbc8 sp=0x1183bba4 pc=0x5df2cc image/jpeg.Decode(0x9b4850, 0x11918030, 0x11918030, 0x9b4850, 0x11918030, 0x2) c:/go/src/image/jpeg/reader.go:779 +0x44 fp=0x1183bbec sp=0x1183bbc8 pc=0x5e00f4 image.Decode(0x9b5630, 0x11807b50, 0x11807b50, 0x9b5630, 0x11807b50, 0x0, 0x0, 0x457cf3) c:/go/src/image/format.go:93 +0xb1 fp=0x1183bc68 sp=0x1183bbec pc=0x5cdbb1 github.com/disintegration/imaging.Decode(...) D:/projects/private/chfs/src/github.com/disintegration/imaging/helpers.go:89 github.com/disintegration/imaging.Open(0x11aadb20, 0x63, 0x0, 0x0, 0x0, 0x0) D:/projects/private/chfs/src/github.com/disintegration/imaging/helpers.go:100 +0xd4 fp=0x1183bcbc sp=0x1183bc68 pc=0x5fa424 chfs/preview/imagepreview.GetPreviewImage(0x11aadb20, 0x63, 0x40, 0x40) D:/projects/private/chfs/src/chfs/preview/imagepreview/image.go:41 +0x2d fp=0x1183bcf4 sp=0x1183bcbc pc=0x5ffb5d chfs/preview.generate.func1(0x11aadb20, 0x63, 0x9bd5e0, 0x11abcea0, 0x0, 0x0, 0x457cf3, 0xd3ade0) D:/projects/private/chfs/src/chfs/preview/preview.go:62 +0x109 fp=0x1183bd34 sp=0x1183bcf4 pc=0x756789 path/filepath.walk(0x11aadb20, 0x63, 0x9bd5e0, 0x11abcea0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:358 +0x2dd fp=0x1183bd98 sp=0x1183bd34 pc=0x5bf96d path/filepath.walk(0x11bf21e0, 0x58, 0x9bd5e0, 0x11abccc0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x1183bdfc sp=0x1183bd98 pc=0x5bf889 path/filepath.walk(0x11864320, 0x4b, 0x9bd5e0, 0x11a8d8c0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x1183be60 sp=0x1183bdfc pc=0x5bf889 path/filepath.walk(0x11a217c0, 0x32, 0x9bd5e0, 0x11a8cd20, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x1183bec4 sp=0x1183be60 pc=0x5bf889 path/filepath.walk(0x1185f3e0, 0x1c, 0x9bd5e0, 0x11879b00, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x1183bf28 sp=0x1183bec4 pc=0x5bf889 path/filepath.walk(0x11860680, 0xd, 0x9bd5e0, 0x11878cc0, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:382 +0x1f9 fp=0x1183bf8c sp=0x1183bf28 pc=0x5bf889 path/filepath.Walk(0x11860680, 0xd, 0x924650, 0x0, 0x0) c:/go/src/path/filepath/path.go:404 +0xdd fp=0x1183bfb8 sp=0x1183bf8c pc=0x5bfa6d chfs/preview.generate(0x11860680, 0xd) D:/projects/private/chfs/src/chfs/preview/preview.go:58 +0x33 fp=0x1183bfd0 sp=0x1183bfb8 pc=0x756673 chfs/preview.PreviewGeneratorDeamon(0x11856600, 0x2, 0x2) D:/projects/private/chfs/src/chfs/preview/preview.go:23 +0x33 fp=0x1183bfe0 sp=0x1183bfd0 pc=0x756333 runtime.goexit() c:/go/src/runtime/asm_386.s:1325 +0x1 fp=0x1183bfe4 sp=0x1183bfe0 pc=0x451671 created by main.main D:/projects/private/chfs/src/chfs/main.go:124 +0x13f0 goroutine 1 [IO wait, 2 minutes]: internal/poll.runtime_pollWait(0x117b90e8, 0x72, 0x9b6530) c:/go/src/runtime/netpoll.go:184 +0x4b internal/poll.(*pollDesc).wait(0x1196c0fc, 0x72, 0xc98600, 0x0, 0x0) c:/go/src/internal/poll/fd_poll_runtime.go:87 +0x37 internal/poll.(*ioSrv).ExecIO(0xd3a214, 0x1196c014, 0x11804100, 0x17, 0x1, 0x0) c:/go/src/internal/poll/fd_windows.go:228 +0xef internal/poll.(*FD).acceptOne(0x1196c000, 0x20c, 0x119580f0, 0x2, 0x2, 0x1196c014, 0x4, 0x46, 0x0, 0x0) c:/go/src/internal/poll/fd_windows.go:896 +0x82 internal/poll.(*FD).Accept(0x1196c000, 0x11c53dc8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) c:/go/src/internal/poll/fd_windows.go:930 +0x12e net.(*netFD).accept(0x1196c000, 0x2c, 0x11836540, 0x1200008) c:/go/src/net/fd_windows.go:193 +0x66 net.(*TCPListener).accept(0x118040e0, 0x11806200, 0x40a69c, 0x20) c:/go/src/net/tcpsock_posix.go:139 +0x27 net.(*TCPListener).Accept(0x118040e0, 0x8c9d20, 0x1181e7a0, 0x8879e0, 0xd314d8) c:/go/src/net/tcpsock.go:261 +0x3c net/http.(*Server).Serve(0x119481b0, 0x9ba330, 0x118040e0, 0x0, 0x0) c:/go/src/net/http/server.go:2896 +0x22f main.main() D:/projects/private/chfs/src/chfs/main.go:189 +0xf58 goroutine 19 [sync.Cond.Wait, 2 minutes]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 sync.runtime_notifyListWait(0x118bc8e8, 0x0) c:/go/src/runtime/sema.go:510 +0x121 sync.(*Cond).Wait(0x118bc8e0) c:/go/src/sync/cond.go:56 +0x66 github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x1185aa20, 0x0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x74 github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x1185aa20) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38 created by github.com/cihub/seelog.NewAsyncLoopLogger D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x72 goroutine 20 [sync.Cond.Wait, 2 minutes]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 sync.runtime_notifyListWait(0x118bca88, 0x0) c:/go/src/runtime/sema.go:510 +0x121 sync.(*Cond).Wait(0x118bca80) c:/go/src/sync/cond.go:56 +0x66 github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x1185aae0, 0x0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x74 github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x1185aae0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38 created by github.com/cihub/seelog.NewAsyncLoopLogger D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x72 goroutine 21 [sync.Cond.Wait, 2 minutes]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 sync.runtime_notifyListWait(0x118e29c8, 0x0) c:/go/src/runtime/sema.go:510 +0x121 sync.(*Cond).Wait(0x118e29c0) c:/go/src/sync/cond.go:56 +0x66 github.com/cihub/seelog.(*asyncLoopLogger).processItem(0x1185b860, 0x0) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:50 +0x74 github.com/cihub/seelog.(*asyncLoopLogger).processQueue(0x1185b860) D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:63 +0x38 created by github.com/cihub/seelog.NewAsyncLoopLogger D:/projects/private/chfs/src/github.com/cihub/seelog/behavior_asynclooplogger.go:40 +0x72 goroutine 22 [sleep, 2 minutes]: runtime.goparkunlock(...) c:/go/src/runtime/proc.go:310 time.Sleep(0x85c50000, 0x1a31) c:/go/src/runtime/time.go:105 +0x159 main.main.func1() D:/projects/private/chfs/src/chfs/main.go:118 +0x2b created by main.main D:/projects/private/chfs/src/chfs/main.go:114 +0x888

当文件名存在+时,无法上传这个文件

我一共有六个文件需要上传,发现有三个文件一直卡住无法完成上传,经过排查发现这三个视频文件都带有“+”这个符号,我把文件重命名删除加号之后即可正常上传

当文件名存在+时,无法上传这个文件

我一共有六个文件需要上传,发现有三个文件一直卡住无法完成上传,经过排查发现这三个视频文件都带有“+”这个符号,我把文件重命名删除加号之后即可正常上传

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.