Skip to content

Commit

Permalink
GitBook: [master] 98 pages modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Hansimov authored and gitbook-bot committed Oct 2, 2020
1 parent b441333 commit bde6a3b
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 1 deletion.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
* [11.5 Web 服务器](di-san-bu-fen-cheng-xu-jian-de-jiao-hu-he-tong-xin/di-11-zhang-wang-luo-bian-cheng/11.5-web-fu-wu-qi.md)
* [11.6 综合:TINY Web 服务器](di-san-bu-fen-cheng-xu-jian-de-jiao-hu-he-tong-xin/di-11-zhang-wang-luo-bian-cheng/11.6-zong-he-tiny-web-fu-wu-qi.md)
* [11.7 小结](di-san-bu-fen-cheng-xu-jian-de-jiao-hu-he-tong-xin/di-11-zhang-wang-luo-bian-cheng/11.7-xiao-jie.md)
* [家庭作业](di-san-bu-fen-cheng-xu-jian-de-jiao-hu-he-tong-xin/di-11-zhang-wang-luo-bian-cheng/jia-ting-zuo-ye.md)
* [第 12 章:并发编程](di-san-bu-fen-cheng-xu-jian-de-jiao-hu-he-tong-xin/di-12-zhang-bing-fa-bian-cheng.md)

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ RFC 通常是为因特网基础设施的开发者编写的,因此,对于普

**http://www.iana.org/assignments/media-types**

Kerrisk 是全面 Linux 编程的圣经,提供了现代网络编程的详细讨论【62】。关于计算机网络互联有大量很好的通用文献【65,84,114 】。伟大的科技作家 W. Richard Stevens 编写了一系列相关的经典文献,如髙级 Unix 编程【111】、因特网协议【09,120,107】,以及 Unix 网络编程【108,110】。认真学习 Unix 系统编程的学生会想要研究所有这些内容。不幸的是,Stevens 在 1999 年 9 月 1 日逝世。我们会永远纪住他的贡献。
Kerrisk 是全面 Linux 编程的圣经,提供了现代网络编程的详细讨论【62】。关于计算机网络互联有大量很好的通用文献【65,84,114 】。伟大的科技作家 W. Richard Stevens 编写了一系列相关的经典文献,如髙级 Unix 编程【111】、因特网协议【109,120,107】,以及 Unix 网络编程【108,110】。认真学习 Unix 系统编程的学生会想要研究所有这些内容。不幸的是,Stevens 在 1999 年 9 月 1 日逝世。我们会永远纪住他的贡献。

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# 家庭作业

## 练习题 11.6

{% tabs %}
{% tab title="练习题 11.6" %}
A. 修改 TINY 使得它会原样返回每个请求行和请求报头。

B. 使用你喜欢的浏览器向 TINY 发送一个对静态内容的请求。把 TINY 的输出记录到一个文件中。

C. 检查 TINY 的输出,确定你的浏览器使用的 HTTP 的版本。

D. 参考 RFC 2616 中的 HTTP/1.1 标准,确定你的浏览器的 HTTP 请求中每个报头的含义。你可以从 **www.rfc-editor.org/rfc.html** 获得 RFC 2616。
{% endtab %}
{% endtabs %}

## 练习题 11.7

{% tabs %}
{% tab title="练习题 11.7" %}
扩展 TINY,使得它可以提供 MPG 视频文件。用一个真正的浏览器来检验你的工作。
{% endtab %}
{% endtabs %}

## 练习题 11.8

{% tabs %}
{% tab title="练习题 11.8" %}
修改 TINY,使得它在 SIGCHLD 处理程序中回收操作系统分配给 CGI 子进程的资源,而不是显式地等待它们终止。
{% endtab %}
{% endtabs %}

## 练习题 11.9

{% tabs %}
{% tab title="练习题 11.9" %}
修改 TINY,使得当它服务静态内容时,使用 malloc、rio\_readn 和而不是 mmap 和 rio\_writen 来复制被请求文件到已连接描述符。
{% endtab %}
{% endtabs %}

## 练习题 11.10

{% tabs %}
{% tab title="练习题 11.10" %}
A. 写出图 11-27 中 CGI adder 函数的 HTML 表单。你的表单应謗包括两个文本框,用户将需要相加的两个数字填在这两个文本框中。你的表单应该使用 GET 方法请求内容。

B. 用这样的方法来检查你的程序:使用一个真正的浏览器向 TINY 请求表单,向 TINY 提交填写好的表单,然后显示 adder 生成的动态内容。
{% endtab %}
{% endtabs %}

## 练习题 11.11

{% tabs %}
{% tab title="练习题 11.11" %}
扩展 TINY,以支持 HTTP HEAD 方法。使用 TELNET 作为 Web 客户端来验证你的工作。
{% endtab %}
{% endtabs %}

## 练习题 11.12

{% tabs %}
{% tab title="练习题 11.12" %}
扩展 TINY,使得它服务以 HTTP POST 方式请求的动态内容。用你喜欢的 Web 浏览器来验证你的工作。
{% endtab %}
{% endtabs %}

## 练习题 11.13

{% tabs %}
{% tab title="练习题 11.13" %}
修改 TINY,使得它可以干净地处理(而不是终止)在 write 函数试图写一个过早关闭的连接时发生的 SIGPIPE 信号和 EPIPE 错误。
{% endtab %}
{% endtabs %}





0 comments on commit bde6a3b

Please sign in to comment.