[ee122] Project 1

Lisa Fowler fowler at eecs.berkeley.edu
Mon Sep 10 22:42:47 PDT 2007

On 9/10/07, Ofer Sadgat <ofer at berkeley.edu> wrote:
> I have a few questions about project 1:
> 1.       When will the server be up to test our solutions against?

Soon.  Stay tuned.

> 2.       How do we deal with the fact that send might not send all of the
> data? This seems like an implementation specific thing and therefore will
> not be compatible with other solutions.

You should test the resultant sent-bytes value against what you
expected to send and make sure to send any left over bytes.  As stated
in beej's guide:

"send() returns the number of bytes actually sent out—this might be
less than the number you told it to send! See, sometimes you tell it
to send a whole gob of data and it just can't handle it. It'll fire
off as much of the data as it can, and trust you to send the rest
later. Remember, if the value returned by send() doesn't match the
value in len, it's up to you to send the rest of the string. The good
news is this: if the packet is small (less than 1K or so) it will
probably manage to send the whole thing all in one go. Again, -1 is
returned on error, and errno is set to the error number."

Your client/server should make sure that it's received everything it's
expecting to receive.  That blank line will be helpful!

> 3.       If an HTTP Request is invalid in many ways, do we print out all
> appropriate error messages? What if it is complete nonsense? What do we
> return to the sender?

No.  You can give the failure on the first discovered non-compliant
element (e.g. "get 1foo dizzle" would give a bad method name message
because the test for the GET token failed first).  Daniel is primary
on this particular project so if he deems otherwise, I trust he'll
chime in.

> 4.       Must the error messages that we print be exactly the same as what
> the guide says? If so, then what about the possible errors that it doesn't
> talk about (such as ones listed above)?

It must be *exactly* as detailed in the project spec.  In the interest
of your grade, you should not deviate.  If there are additional errors
that we deem appropriate to add, we'll add them.

> 5.       What do we do if the server runs out of memory?

We'll get back to you on this.

> 6.       Can our server be more compliant than the standard allows? E.g.
> allow +Space to equal space | tab | newline or no new line at the end.

No.  You must obey the spec exactly as we have listed it in the assignment.

> 7.       Can you post the next part of the project?

That's coming shortly!


> Thanks,
> Ofer
> _______________________________________________
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122

More information about the ee122 mailing list