2

I am currently going through server.c in pset 6.

this is server.c: https://gist.github.com/anonymous/5b24f101bf5d53018cbc

my functions:

lookup: https://gist.github.com/anonymous/04e1581f78263e60766e

parse: https://gist.github.com/anonymous/3f4e323a09c38c3ed87a

indexes: https://gist.github.com/anonymous/9b456e088be7e3854b7d

load: https://gist.github.com/anonymous/0faba2e7a7fde010ca92

I am trying to debug but I don't really know what's the problem :/ I am currently blaming load();

It's also weird because I get cat.jpg correctly only the first time the server is ever asked:

https://gist.github.com/anonymous/5caba13b89cbd3581839

2

At least part of your problem is in parse. abs_path is not null terminated. That would cause the behaviour you describe (I get cat.jpg correctly only the first time the server is ever asked:) query, if it exists, is not null-terminated either, which will create different problems down the road.

| improve this answer | |
  • by the way thank you! – Rafael Mar 19 '16 at 17:33

You must log in to answer this question.

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