H sysstath fcntlh sysmmanh errnoh mathh pthreadh

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: criptor. The CGI program would then read the arguments in the request body from standard input. End Aside. Notice that since the parent does not know the type or size of the content that the child generates, the child is responsible for generating the Content-type and Content-length response headers, as well as the empty line that terminates the headers. Figure 12.44 shows a simple CGI program that sums its two arguments and returns an HTML file with the result to the client. Figure 12.45 shows an HTTP transaction that serves dynamic content from the adder program. Practice Problem 12.7: In Section 12.4.8, we warned about the dangers of using the C standard I/O functions in servers. Yet the CGI program in Figure 12.44 is able to use standard I/O without any problems. Why? 12.8 Putting it Together: The T INY Web Server We will conclude our discussion of network programming by developing a small but functioning Web server called T INY. T INY is an interesting program. It combines many of the ideas that we have learned about concurrency, Unix I/O, the sockets interface,...
View Full Document

Ask a homework question - tutors are online