0

After first submit for pset6 server.c, I've got only 0 (zeros). Even if part of test should pass, i.e. Requesting cat.html returns 200, text/html, and correct file.

When I run server and use in second tab https://ide50-xxxxxx.cs50.io/cat.html

I can see happy cat and right messages as well.

Listening on port 8080
GET /cat.html HTTP/1.1
HTTP/1.1 200 OK
GET /cat.jpg HTTP/1.1
HTTP/1.1 200 OK
GET /favicon.ico HTTP/1.1
HTTP/1.1 200 OK

Before submit was no test rules in GradeBook Problem Set 6. Now I can see how they test my code.

How to test it locally ?

How to send to server wrong method or request-target ?

Should I use telnet or other tool ?

2

I created a separate file called servertest.c to use while working through parse, the stage I just finished. I used a simple main like this to test various inputs to parse:

int main(void)
{
    char* l = "GET /index.html HTTP/1.1\r\n";
    parse(l, p, q);
}

Additionally, I used this at the end of it all to make sure it looked right:

printf("Here is the absolute-path: %s\n", abs_path);
printf("Here is the query: %s\n", query);

By modifying l in each of the ways enumerated in the gradebook, I was able to identify and fix all the issues in parse.

I'm still in the midst of load, so hopefully I'm not way off for how I've been implementing server, but from what I can tell, I was able to correct all the relevant errors and meet all the requirements for parse.

2
  • I have created an extra file too. Not exactly the same main as Yours and copy of parse have only l as line variable. Now my code is correct for more requirements. I try to submit this.
    – iJuliusz
    Feb 21 '16 at 15:52
  • Nice work! You can also use the curl tool as specified in the pset specs to perform more tests. If this has answered your question, please check to accept. :-)
    – Peter
    Feb 21 '16 at 15:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .