Today I am starting this Lab and blogging about it. After spending a few minutes on this project, I realized that I am struggling to help.
5/3/17
I am still confused so I am going to ask people for help.
5/4/17
Mary helped me by showing me her code and what she did.
5/5/17
After looking back over the code and Mary's code, I think I was just overwhelmed since I was behind in class that I just did not spend the time to full look over the code and address to fully understand what to do and just did not do the work.
Write Up:
1) Introduction: The purpose of this assignment was to mess with the given code for a multithreaded web server and then try to modify it to demonstrate if we understood what networking principles behind it.
2) Discussion of Solution: Chrome, I problem I faced was getting my if statement to see which browser was being used to work. This was due to user error because I typed if "Chrome " in HHTP_Version: which caused the program to output that I was using Safari or another browser. Once I saw that in the HTTP_Version for Chrome had Chrome/58.0.3029.96 in it Chrome , I changed the if statement to reflect that and the code worked perfectly.
3) Testing Plan: When testing to see how to figure out if the code already could identify a browser or if I had to code it myself, I ran the SimpleServer on Chrome, Firefox, and Internet Explorer and saw that they all had a different user agent. The user agent for Chrome is Chrome/58.0.3029.96, for Firefox its Firefox/50.0 and for internet Explorer it is Trident/7.0.
5) Commented Listings: I am not able to get Doxygen to install on the Burr Lab and I do not know any other way to do this outside of comments in the actual code.
6) Quality: I attempted to blog as I went even though I did not work on this over a short period of time.
Here you can see the output after running the server and going to http://localhost:8080/ on the different browsers.
| Chrome |
| FireFox |
| Internet Explore |
Because HTTP 1.1 is supposed to have persistent connections unless otherwise stated, I believe that just by commenting out self.connectionSocket.shutdown(SHUT_RDWR) and self.connectionSocket.close(), that should be the way to make this server support persistent connects, but I to think that this is bad code and over simplified. I believe this to be true because I looked it up and on w3.org where which you always reference, states "A significant difference between HTTP/1.1 and earlier versions of HTTP is that persistent connections are the default behavior of any HTTP connection. That is, unless otherwise indicated, the client SHOULD assume that the server will maintain a persistent connection, even after error responses from the server."
Source: https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1
Under Section 8.1.2
Source: https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1
Under Section 8.1.2
No comments:
Post a Comment