Well, I'd see if everyone else is happy first, but personally that looks good 
to me.

Whats the difference between 200 and 290?

I also think that the first line should echo back the command with its 
arguments.

This would mean something like:

400 ERROR uknown /etc/foo
401 ERR <errno code> FILE NOT FOUND

Would it be better to have each minor error detail use a different number?

Thoughts?

Joel
PS Like that trick with the stringstream

Timothy Brownawell wrote:
On 5/17/05, Joel Crisp <[EMAIL PROTECTED]> wrote:

Yep, a number at the beginning of each line. It lets you detect the start of 
the next header, distinguish different types of output
easily, handle optional or repeated blocks of output etc. It also allows you to 
detect badly or prematurely terminated blocks, since
the start of the next command will cause a reset.


Hmm...

200 success
250 output
290 done (successful)

400 error/general
410 error/syntax
420 error/unknown command
450 error text
490 done (not successful)


I think the change to the existing commands should be fairly minor, an extra %s at the 
start of the printf which is either "201 " or
"" for each line.


After poking around a bit, it turns out to be even easier. Pass the
command a stringstream instead of the real output, and run
"prefix_lines_with" (transforms.hh) on it before printing.


I don't think stripping line prefixes is an insurmountable problem - after all, 
there are many other protocols which do something
similar.

Read the RFC for dict (http://www.faqs.org/rfcs/rfc2229.html) or the mailing 
list expansion in SMTP
(http://www.faqs.org/rfcs/rfc821.html) for more examples




_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to