I have just finished lookup and parse function and for the first time when I tried to run the first check50 I am getting 2 errors, one for cat.exe and the other one for non-exsistant file, but I dont remember there were any info given about cat.exe or the nonexsistence file in the specs, I am kind of lost here as where my error might be? in lookup or in parse and how to solve it??enter image description here


Basically, cat.exe and non-existAnt file test parse and lookup. It looks like your parse is always returning a 505. That is probably from the HTTP version test.

From the spec

Per 3.1.1 of http://tools.ietf.org/html/rfc7230, a request-line is defined as
method SP request-target SP HTTP-version CRLF
wherein SP represents a single space ( ) and CRLF represents \r\n.

(It would be difficult to test for that input using your test program and GetString because of the terminating CRLF.)

There are any number of ways to extract the HTTP-version from line. The only valid string after the second space will be "HTTP/1.1\r\n".

  • Just corrected my HTTP test to HTTP/1.1\r\n and it got rid of the error of non exsistant file but now the cat.exe check changes to a "HTTP/1.1 404 Not Found\r\nContent-Type:... Aug 29 '16 at 17:33
  • cat.exe should get a 501 (not implemented) from lookup. So maybe there is a problem in your lookup function? Aug 29 '16 at 21:17
  • just reviewed server.c and realized program will give 404 before it gets to lookup (around line 209). So likely your abs_path is not quite right, perhaps not properly null-terminated. Aug 29 '16 at 23:44
  • THANKS a lot, man you have been of so much help to me in this pset. Now on to the load function which according to you is the toughest in this pset, you'll see some more question from me soon in the forum ;) Aug 30 '16 at 6:29

You must log in to answer this question.

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