Skip to content

Commit

Permalink
调整代码缩进
Browse files Browse the repository at this point in the history
修改了makefile:
1. 去掉了makefile中的-lsocket
2. 修改了书写方法

修改了httpd.c:
1. 对标准输入输出文件描述符加了宏定义,
2. 修正了几个隐式类型转换导致warning的地方
3. 增加了一处对请求类型是否是post的具体判断,之前仅将else判定为POST,忽略了HEAD等类型
4. 执行CGI的execl语句的第二个参数是否有误?
  • Loading branch information
vagrant authored and ZiWee committed Apr 6, 2016
1 parent 16ee684 commit bc9dfb5
Show file tree
Hide file tree
Showing 4 changed files with 369 additions and 358 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
all: httpd

all: httpd client
LIBS = -lpthread #-lsocket
httpd: httpd.c
gcc -W -Wall -lsocket -lpthread -o httpd httpd.c
gcc -g -W -Wall $(LIBS) -o $@ $<

client: simpleclient.c
gcc -W -Wall -o $@ $<
clean:
rm httpd
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
A mirror for tinyhttpd
测试CGI时需要本机安装PERL,同时安装perl-cgi

<p>&nbsp; &nbsp; &nbsp;每个函数的作用:</p>
<p>&nbsp; &nbsp; &nbsp;accept_request: &nbsp;处理从套接字上监听到的一个 HTTP 请求,在这里可以很大一部分地体现服务器处理请求流程。</p>
Expand Down
Loading

0 comments on commit bc9dfb5

Please sign in to comment.