C figure a5 wrapper for posix style pthread cond

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: vironment variables that a CGI program can expect to be set when it runs. Figure 12.43 shows a subset. 652 Environment variable SERVER PORT REQUEST METHOD REMOTE HOST REMOTE ADDR CONTENT TYPE CONTENT LENGTH CHAPTER 12. NETWORK PROGRAMMING Description Port that the parent is listening on GET or POST Domain name of client Dotted-decimal IP address of client POST only: MIME type of the request body POST only: Size in bytes of the request body Figure 12.43: Examples of CGI environment variables. Where Does the Child Send its Output? A CGI program prints dynamic content to the standard output. Before the child process loads and runs the CGI program, it uses the Unix dup2 function to redirect standard output to the connected descriptor that is associated with the client. Thus, anything that the CGI program writes to standard output goes directly to the client. Aside: Passing arguments to HTTP POST requests. For POST requests, the child would also need to redirect standard input to the connected des...
View Full Document

Ask a homework question - tutors are online