Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • After reading the man page, I still don't fully understand. Am I in the right track(about the following question)? When I implement "validate request-line", and "ensure path exists(and readable)", should I use "line" or "request" for the second argument(const void *buf) of "write" ? And should I use "octets" for the third argument(size_t count) of "write" ? Commented Feb 24, 2015 at 16:52
  • @Yung-ChengHsu why would you use write to validate the request-line or ensure the path exists? Commented Feb 24, 2015 at 22:54
  • Well, I'm not really sure when to use "write", since it says like "• if method is not GET , respond to the browser with 405 Method Not Allowed" for validate request-line and "Ensure that path actually exists. Respond to the browser with 404 Not Found if not!" for checking the existence in the pset6 pdf file. They both mentioned "respond to the browser", I just want to know when to use "write" after "dprintf", since there's "write" when we "respond to client". Isn't it responding with the same thing? Commented Feb 26, 2015 at 0:59
  • @Yung-ChengHsu if I may ask, did you read the whole specs? Did you read the whole distribution code? Commented Feb 26, 2015 at 10:20
  • Yes, I did. but I just read it again a few hours ago, and suddenly I realize I have got the wrong idea. Now, I have finished pset6, and thanks for your comments and answers! Commented Feb 27, 2015 at 12:36