Re: [PATCH] don't expect inode name to be NUL-terminated (avoid read overrun)

2010-09-10 Thread Colin McCabe
The thing is, snprintf always NULL-terminates its output string, no matter whether the input was NULL-terminated or not. However, I looked at the snprintf man page again and found this description for %s : > If no l modifier is present: The const char * argument is expected to be > a pointer to

Re: Zookeeper instead of CLD in Hail

2010-06-08 Thread Colin McCabe
need > more NIH syndrome. It would be cool to have support another backend, I guess. However... It seems to me that once you make the decision to use ZooKeeper and Java, Walrus or Hadoop is probably a more practical choice for the upper layers. I've never deployed either though, so I could be wr

Re: tabled test corpus?

2010-03-05 Thread Colin McCabe
Random thoughts: Maybe something like a freely available dictionary would work, with the key as the word, and the value as the definition. You could grab git commits from the Linux kernel and make the key the SHA, and the value the patch. There's a lot of text in Project Gutenberg. I guess you'd

about paxos

2010-02-09 Thread Colin McCabe
Speaking of CLD replication, I read a really good description of paxos recently: http://the-paper-trail.org/blog/?p=173 It helps if you read the entries on two-phase locking and three-phase locking first: http://the-paper-trail.org/blog/?p=90 http://the-paper-trail.org/blog/?p=103 This is about

Re: [PATCHv2] cld: use XDR for all messages

2010-02-09 Thread Colin McCabe
On Tue, Feb 9, 2010 at 5:33 PM, Jeff Garzik wrote: > On 02/09/2010 07:21 PM, Pete Zaitcev wrote: >> >> On Tue, 09 Feb 2010 18:21:02 -0500 >> Jeff Garzik  wrote: >> >>> So, the programs themselves have it right -- debug/verbose is an integer >>> not a bool.  The internal libraries get that wrong so

[PATCH] cld: use portable Makefile rules for rpcgen files

2010-02-09 Thread Colin McCabe
Signed-off-by: Colin McCabe --- lib/Makefile.am |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index d3f1a5d..75b7233 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -10,10 +10,10 @@ INCLUDES= -I$(top_srcdir

Re: [PATCHv2] cld: use XDR for all messages

2010-02-05 Thread Colin McCabe
Great news! And thanks for your help in splitting what admittedly was a monster patch into something more manageable. :) Colin On Fri, Feb 5, 2010 at 1:48 AM, Jeff Garzik wrote: > On 01/15/2010 12:49 PM, Colin McCabe wrote: >> >> This patch moves CLD from using manual data s

[PATCH 3/3] cld: Add XDR support to lib/Makefile.am

2010-02-04 Thread Colin McCabe
Add support for processing XDR files to lib/Makefile.am Signed-off-by: Colin McCabe --- lib/Makefile.am |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index e6509e4..7d5f8c2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am

[PATCH 2/3] cld: Add XDR files to gitignore

2010-02-04 Thread Colin McCabe
Signed-off-by: Colin McCabe --- .gitignore |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 79a4cd3..805fa22 100644 --- a/.gitignore +++ b/.gitignore @@ -32,5 +32,9 @@ cld-config.h* cscope.* ncscope.* +# XDR files +*_rpc.h +*_rpc_xdr.c

[PATCH 1/3] cld: Create cldc_call_opts_get_data API for GET

2010-02-04 Thread Colin McCabe
Create the cldc_call_opts_get_data API. This allows users of the async CLD api to access the GET buffer returned from CLD without playing with parts of the cld_call_opts marked 'private, lib-owned.' Signed-off-by: Colin McCabe --- include/cldc.h |2 ++ lib/cldc.c

Re: [PATCHv2 1/2] cld: fix CLD_INODE_NAME_MAX woes

2010-02-03 Thread Colin McCabe
On Wed, Feb 3, 2010 at 2:27 PM, Jeff Garzik wrote: > On 02/03/2010 08:45 AM, Colin McCabe wrote: >> >> When we create a static buffer for an inode name, and treat it like a >> null-terminated string, it needs to be of length CLD_INODE_NAME_MAX + 1 so >> that it c

[PATCHv2 2/2] cld: kill CLD_MAX_PKT_MSG, add CLD_MAX_PAYLOAD_SZ

2010-02-03 Thread Colin McCabe
not to do it often. Signed-off-by: Colin McCabe --- include/cld_msg.h |7 --- include/cldc.h|4 ++-- lib/cldc.c| 24 +--- server/msg.c |7 +++ server/session.c | 12 5 files changed, 38 insertions(+), 16 deletions

[PATCHv2 1/2] cld: fix CLD_INODE_NAME_MAX woes

2010-02-03 Thread Colin McCabe
This isn't strictly necessary if all other checks are working perfectly, but it seems prudent. Signed-off-by: Colin McCabe --- include/cldc.h |2 +- lib/cldc.c |4 ++-- tools/cldcli.c |1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/cldc.h b/incl

Re: [PATCH] Re: [PATCHv2] cld: use XDR for all messages

2010-02-03 Thread Colin McCabe
On Tue, Feb 2, 2010 at 10:35 PM, Jeff Garzik wrote: > On 01/29/2010 08:01 PM, Colin McCabe wrote: >> >> That seems reasonable. All of those functions could be looked at as >> "common." >> >> The intention was to group together a bunch of function

[PATCH 2/2] cld: kill CLD_MAX_PKT_MSG, add CLD_MAX_PAYLOAD_SZ

2010-02-03 Thread Colin McCabe
not to do it often. Signed-off-by: Colin McCabe --- include/cld_msg.h |7 --- include/cldc.h|4 ++-- lib/cldc.c| 24 +--- server/msg.c |7 +++ server/session.c | 12 tools/cldcli.c|2 +- 6 files changed, 39

[PATCH 1/2] cld: fix CLD_INODE_NAME_MAX woes

2010-02-03 Thread Colin McCabe
ly, but it seems prudent. Signed-off-by: Colin McCabe --- include/cldc.h |2 +- lib/cldc.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/cldc.h b/include/cldc.h index f1db7d2..0d72669 100644 --- a/include/cldc.h +++ b/include/cldc.h @@ -41,7 +41,7

Re: [PATCHv2] cld: use XDR for all messages

2010-01-29 Thread Colin McCabe
That seems reasonable. All of those functions could be looked at as "common." The intention was to group together a bunch of functions that were useful for packet formatting. Although the bulk of the formatting is done by XDR, there are some things that XDR doesn't do, like generating and checking

Re: [PATCHv2] cld: use XDR for all messages

2010-01-26 Thread Colin McCabe
On Tue, Jan 26, 2010 at 2:11 PM, Jeff Garzik wrote: > Actually I poked at it this weekend, and was about to finish up.  So hold > off for another day, if you would. > > The answer is, there are two different build environments to consider for > headers:  the in-tree build environment, and the inst

Re: [PATCHv2] cld: use XDR for all messages

2010-01-26 Thread Colin McCabe
possible. I really don't want to put cld_msg_rpc_xdr.c in include/. But so far I can't figure out how to have the header there, without the .c file... Colin On Wed, Jan 20, 2010 at 6:38 PM, Colin McCabe wrote: > On Wed, Jan 20, 2010 at 5:38 PM, Jeff Garzik wrote: >> On 01/1

Re: [PATCHv2] cld: use XDR for all messages

2010-01-20 Thread Colin McCabe
On Wed, Jan 20, 2010 at 5:38 PM, Jeff Garzik wrote: > On 01/15/2010 12:49 PM, Colin McCabe wrote: >> >> This patch moves CLD from using manual data serialization to using XDR >> (via >> rpcgen). Both the packet header and the message body are now serialized >> an

Re: the evils of the CLD api

2010-01-16 Thread Colin McCabe
On Sat, Jan 16, 2010 at 3:21 PM, Pete Zaitcev wrote: > On Sat, 16 Jan 2010 13:38:26 -0800 > Colin McCabe wrote: > >> Shouldn't ncld_unlock and ncld_close return an error code rather than >> just eating all errors? The server certainly does sometimes send back &g

Re: the evils of the CLD api

2010-01-16 Thread Colin McCabe
ions are nonblocking. You have to have a state machine in your program anyway-- you might as well keep it simple and all in one place. What do you guys think? regards, Colin On Fri, Jan 15, 2010 at 10:53 PM, Pete Zaitcev wrote: > On Fri, 15 Jan 2010 18:40:44 -0800 > Colin McCabe

Re: [Patch 1/2] CLD: export a common timer implementation

2010-01-16 Thread Colin McCabe
On Fri, Jan 15, 2010 at 11:07 PM, Pete Zaitcev wrote: > Although we share the libtimer.a among the parts that can link it > statically, it turned out impossible to use from inside of libcldc > as it was. So, this patch makes it available to library code by > linking it in the same way we use libco

the evils of the CLD api

2010-01-15 Thread Colin McCabe
Hi all, I saw Pete's post about "the evils of event-driven programming in CLD clients." I tend to agree with him that the current API can be frustrating to think about. I had a few thoughts about what might be a better API: 1) when starting the cld session, the user code could register a "vtable

Re: [PATCH] cld: use XDR for all messages

2010-01-13 Thread Colin McCabe
On Wed, Jan 13, 2010 at 4:10 PM, Jeff Garzik wrote: > OK, final review. Please fix these problems and resend (some of these > repeated from other emails; putting here to consolidate): > > * needs to build patch builds and runs against a fresh git repo clone + > ./autogen.sh + ./configure + make

Re: [PATCH] tabled: use LL to indicate 64-bit constant

2010-01-12 Thread Colin McCabe
ong isn't big enough (because we're on 32 bit), and then issues a warning. And then it promotes to the gcc-specific long long type. Colin On Tue, Jan 12, 2010 at 11:24 AM, Jeff Garzik wrote: > On 01/12/2010 01:25 PM, Colin McCabe wrote: >> >> util.c: In function ‘objid_in

Re: [PATCH] tabled: use LL to indicate 64-bit constant

2010-01-12 Thread Colin McCabe
issues a warning for some reason. I guess gcc's C99 support is not perfect. Colin On Tue, Jan 12, 2010 at 6:29 AM, Jeff Garzik wrote: > On 01/10/2010 08:10 AM, Colin McCabe wrote: >> >> All integer constants are squashed into ints (i.e. 32-bit) unless you >> specify >>

Re: [PATCH] tabled: use new cld api

2010-01-11 Thread Colin McCabe
Hmm...I don't think chunkd needs a patch... at least at change a129ef0d5c. It doesn't touch carg->u.get.buf or carg->u.get.size, since it never calls cldc_get. Colin On Mon, Jan 11, 2010 at 5:26 AM, Jeff Garzik wrote: > On 01/10/2010 10:22 AM, Colin McCabe wrote: >>

[PATCH] tabled: use new cld api

2010-01-10 Thread Colin McCabe
Signed-off-by: Colin McCabe --- server/cldu.c | 21 + 1 files changed, 9 insertions(+), 12 deletions(-) diff --git a/server/cldu.c b/server/cldu.c index d02eafd..dbad4db 100644 --- a/server/cldu.c +++ b/server/cldu.c @@ -545,8 +545,8 @@ static int cldu_put_cb(struct

[PATCH] tabled: use LL to indicate 64-bit constant

2010-01-10 Thread Colin McCabe
All integer constants are squashed into ints (i.e. 32-bit) unless you specify otherwise. Signed-off-by: Colin McCabe --- server/util.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/server/util.c b/server/util.c index 3c15123..63a3acb 100644 --- a/server/util.c +++ b

[PATCH] cld: git should ignore cscope temporary files

2010-01-04 Thread Colin McCabe
Signed-off-by: Colin McCabe --- .gitignore |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 067bf1a..79a4cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,9 @@ cldbadm cld*.tar.gz cld-config.h* +# cscope files +cscope

[PATCH] cld: check parameters for HAIL_LOG

2010-01-04 Thread Colin McCabe
too few arguments, or arguments of the wrong types. For non-GCC compilers, don't do anything (yet). Signed-off-by: Colin McCabe --- include/hail_log.h |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/include/hail_log.h b/include/hail_log.h index d6794b4..88

[PATCH] cld: check parameters for HAIL_LOG

2010-01-03 Thread Colin McCabe
compilers, don't do anything (yet). Signed-off-by: Colin McCabe --- include/hail_log.h |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/include/hail_log.h b/include/hail_log.h index d6794b4..88074a3 100644 --- a/include/hail_log.h +++ b/include/hail_log.h @@

[PATCH 1/2] cld: git should ignore cscope temp files

2010-01-03 Thread Colin McCabe
Signed-off-by: Colin McCabe --- .gitignore |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 067bf1a..79a4cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,9 @@ cldbadm cld*.tar.gz cld-config.h* +# cscope files +cscope

[PATCH] cld: check parameters for HAIL_LOG

2010-01-01 Thread Colin McCabe
duplicate email. I forgot the signoff originally. Signed-off-by: Colin McCabe --- include/hail_log.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/hail_log.h b/include/hail_log.h index d6794b4..ca26f22 100644 --- a/include/hail_log.h +++ b/include/hail_log.h

[PATCH] cld: check parameters for HAIL_LOG

2010-01-01 Thread Colin McCabe
GCC has a nifty ability to typecheck varargs functions that follow the printf conventions. This change uses that in HAIL_LOG. If you build with -Wall, gcc can now give warnings about HAIL_LOG invocations where there are too many or too few arguments, or arguments of the wrong types. --- include/ha

[PATCH] cld: make git ignore cscope temp files

2010-01-01 Thread Colin McCabe
Signed-off-by: Colin McCabe --- .gitignore |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 067bf1a..79a4cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,9 @@ cldbadm cld*.tar.gz cld-config.h* +# cscope files +cscope

[PATCH 9/8 v3] cld: Export hail_log.h to the include directory

2009-12-15 Thread Colin McCabe
I almost forgot-- Makefile.am needs to change. Signed-off-by: Colin McCabe --- include/Makefile.am |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index f7539dd..4ea11c4 100644 --- a/include/Makefile.am +++ b/include

[PATCH 8/8 v3] tabled: Use hail_log API to call libcldc

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- server/cldu.c | 14 -- server/tabled.h |1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/server/cldu.c b/server/cldu.c index e66ec02..e256e6a 100644 --- a/server/cldu.c +++ b/server/cldu.c @@ -918,6 +918,11 @@ int cld_begin

[PATCH 7/8 v3] chunkd: Use hail_log API to call libcldc

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- server/cldu.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/server/cldu.c b/server/cldu.c index 0cf687f..da5f55f 100644 --- a/server/cldu.c +++ b/server/cldu.c @@ -615,8 +615,12 @@ int cld_begin(const char *thishost, const

[PATCH 5/8 v3] cld: modify cld-dns to use logging macros

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/cldc.h |7 ++--- lib/cldc-dns.c | 80 +--- tools/cldcli.c | 12 +--- 3 files changed, 41 insertions(+), 58 deletions(-) diff --git a/include/cldc.h b/include/cldc.h index 1382a23..5419cc8

[PATCH 6/8 v3] cld: Tweak some log levels in cldc dns

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- lib/cldc-dns.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cldc-dns.c b/lib/cldc-dns.c index d58a8ba..1bf6355 100644 --- a/lib/cldc-dns.c +++ b/lib/cldc-dns.c @@ -46,7 +46,7 @@ int cldc_saveaddr(struct cldc_host *hp

[PATCH 4/8 v3] cld: modify server code to use logging macros

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- server/cld.h |4 +- server/cldb.c|7 ++-- server/msg.c | 50 +- server/server.c | 87 - server/session.c | 58 ++- server

[PATCH 3/8 v3] cld: modify client code to use logging macros

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/cldc.h |5 +-- lib/cldc.c | 98 +++- tools/cldcli.c |2 +- 3 files changed, 43 insertions(+), 62 deletions(-) diff --git a/include/cldc.h b/include/cldc.h index 3f0deb5..1382a23 100644

[PATCH 2/8 v3] cld: create logging macros

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/hail_log.h | 31 +++ 1 files changed, 31 insertions(+), 0 deletions(-) create mode 100644 include/hail_log.h diff --git a/include/hail_log.h b/include/hail_log.h new file mode 100644 index 000..f825b89 --- /dev/null

[PATCH 0/8 v3] logging refactoring

2009-12-15 Thread Colin McCabe
This patch series creates some logging macros in hail_log.h and modifies cld to use them. It also converts chunkd and tabled to use the new cld API. version 3: * move logging macros out of common.h and into hail_log.h * add patches for chunkd and tabled version 2: * Rename CLD_DEBUG, etc. to HAIL

[PATCH 1/8 v3] cld: Declare common.c functions in common.h

2009-12-15 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/cld_msg.h | 10 -- include/cldc.h|1 + include/common.h | 11 +++ 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 include/common.h diff --git a/include/cld_msg.h b/include/cld_msg.h index 641b857

Re: [PATCH 0/6 v2] logging refactoring

2009-12-14 Thread Colin McCabe
On Mon, Dec 14, 2009 at 12:36 PM, Jeff Garzik wrote: > On 12/14/2009 02:23 AM, Colin McCabe wrote: >> >> Hi all, >> >> I think I'm going to respin this patch to be a lot smaller. Just >> refactor one or two things, but leave the existing "verbose" a

Re: [PATCH 0/6 v2] logging refactoring

2009-12-13 Thread Colin McCabe
e, Dec 8, 2009 at 4:11 PM, Colin McCabe wrote: > This patch series creates a common.h and populates it with some function > prototypes and logging stuff. > > version 2: > * Rename CLD_DEBUG, etc. to HAIL_DEBUG > * use angle brackets for including common.h from include/ > > Col

Re: [PATCH 5/6] cld: modify cld-dns to use logging macros

2009-12-09 Thread Colin McCabe
On Wed, Dec 9, 2009 at 12:35 PM, Pete Zaitcev wrote: > On Tue,  8 Dec 2009 16:11:55 -0800 > Colin McCabe wrote: > >> @@ -161,8 +153,8 @@ static void push_host(GList **host_list, struct >> cldc_host *hp_in) >>   * This is not reentrant.  Better be called before a

[PATCH 2/6] cld: create logging macros

2009-12-09 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/common.h | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/include/common.h b/include/common.h index 52e5603..f6ad4f6 100644 --- a/include/common.h +++ b/include/common.h @@ -8,4 +8,31 @@ void __cld_rand64

[PATCH 6/6] cld: Tweak some log levels in cldc dns

2009-12-09 Thread Colin McCabe
Signed-off-by: Colin McCabe --- lib/cldc-dns.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cldc-dns.c b/lib/cldc-dns.c index d58a8ba..1bf6355 100644 --- a/lib/cldc-dns.c +++ b/lib/cldc-dns.c @@ -46,7 +46,7 @@ int cldc_saveaddr(struct cldc_host *hp

[PATCH 5/6] cld: modify cld-dns to use logging macros

2009-12-09 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/cldc.h |7 ++--- lib/cldc-dns.c | 80 +--- tools/cldcli.c | 12 +--- 3 files changed, 41 insertions(+), 58 deletions(-) diff --git a/include/cldc.h b/include/cldc.h index 584e026..abec747

[PATCH 4/6] cld: modify server code to use logging macros

2009-12-09 Thread Colin McCabe
Signed-off-by: Colin McCabe --- server/cld.h |4 +- server/cldb.c|6 ++-- server/msg.c | 49 +- server/server.c | 86 -- server/session.c | 57 ++-- server

[PATCH 3/6] cld: modify client code to use logging macros

2009-12-09 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/cldc.h |4 +-- lib/cldc.c | 98 +++- tools/cldcli.c |2 +- 3 files changed, 42 insertions(+), 62 deletions(-) diff --git a/include/cldc.h b/include/cldc.h index 3f0deb5..584e026 100644

[PATCH 1/6] cld: Declare common.c functions in common.h

2009-12-09 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/cld_msg.h | 10 -- include/cldc.h|1 + include/common.h | 11 +++ 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 include/common.h diff --git a/include/cld_msg.h b/include/cld_msg.h index 641b857

[PATCH 0/6 v2] logging refactoring

2009-12-09 Thread Colin McCabe
This patch series creates a common.h and populates it with some function prototypes and logging stuff. version 2: * Rename CLD_DEBUG, etc. to HAIL_DEBUG * use angle brackets for including common.h from include/ Colin McCabe (6): cld: Declare common.c functions in common.h cld: create logging

Re: [PATCH 4/6] cld: modify server code to use logging macros

2009-12-08 Thread Colin McCabe
On Tue, Dec 8, 2009 at 10:13 AM, Pete Zaitcev wrote: > On Mon,  7 Dec 2009 16:43:02 -0800 > Colin McCabe wrote: > >> +++ b/server/cld.h >> @@ -26,6 +26,7 @@ >>  #include >>  #include "cldb.h" >>  #include >> +#include "common.h"

[PATCH 6/6] cld: Tweak some log levels in cldc dns

2009-12-08 Thread Colin McCabe
Signed-off-by: Colin McCabe --- lib/cldc-dns.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cldc-dns.c b/lib/cldc-dns.c index 41bcf60..6e0aec0 100644 --- a/lib/cldc-dns.c +++ b/lib/cldc-dns.c @@ -46,7 +46,7 @@ int cldc_saveaddr(struct cldc_host *hp

[PATCH 5/6] cld: modify cld-dns to use logging macros

2009-12-08 Thread Colin McCabe
Signed-off-by: Colin McCabe --- include/cldc.h |7 ++--- lib/cldc-dns.c | 80 +--- tools/cldcli.c | 12 +--- 3 files changed, 41 insertions(+), 58 deletions(-) diff --git a/include/cldc.h b/include/cldc.h index 70062cf..f0a1b37

[PATCH 4/6] cld: modify server code to use logging macros

2009-12-08 Thread Colin McCabe
From: Colin McCabe Signed-off-by: Colin McCabe --- server/cld.h |4 +- server/cldb.c|6 ++-- server/msg.c | 49 +- server/server.c | 86 -- server/session.c | 57

[PATCH 3/6] cld: modify client code to use logging macros

2009-12-08 Thread Colin McCabe
From: Colin McCabe Signed-off-by: Colin McCabe --- include/cldc.h |4 +-- lib/cldc.c | 98 +++- tools/cldcli.c |2 +- 3 files changed, 42 insertions(+), 62 deletions(-) diff --git a/include/cldc.h b/include/cldc.h index 3f0deb5

[PATCH 1/6] cld: Declare common.c functions in common.h

2009-12-08 Thread Colin McCabe
From: Colin McCabe Signed-off-by: Colin McCabe --- include/cld_msg.h | 10 -- include/cldc.h|1 + include/common.h | 11 +++ 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 include/common.h diff --git a/include/cld_msg.h b/include/cld_msg.h

[PATCH 2/6] cld: create logging macros

2009-12-08 Thread Colin McCabe
From: Colin McCabe Signed-off-by: Colin McCabe --- include/common.h | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/include/common.h b/include/common.h index 52e5603..30610d8 100644 --- a/include/common.h +++ b/include/common.h @@ -8,4 +8,31

[PATCH 0/6] logging refactoring

2009-12-08 Thread Colin McCabe
This patch series creates a common.h and populates it with some function prototypes and logging stuff. The changes here are fairly minor and mostly consist of switching over to use the new logging macros. Probably the most helpful one is CLD_DEBUG, which only evaluates its arguments if log->verbos

XDR print?

2009-12-06 Thread Colin McCabe
I'm wondering if there's a function that will take a buffer full of XDR data and an xdrproc_t, and print out a human readable version of the data. It seems like an obvious debugging tool, but I can't find a reference to anything like this in the XDR docs. I guess the obvious workaround is to deser

[RFCv2] cld: replace "if (verbose) { act_log }" with CLD_DEBUG

2009-12-06 Thread Colin McCabe
tly need two extra parameters-- the logging function, and the verbose flag. It's cleaner to condense this into one parameter. 2. The if (verbose) sess->act_log pattern leads to an excessive level of indentation, which tends to make things more unclear. version 2: add common.h Signed-off-by: C

[RFC] cld: replace "if (verbose) { act_log }" with CLD_DEBUG

2009-12-06 Thread Colin McCabe
two extra parameters-- the logging function, and the verbose flag. It's cleaner to condense this into one parameter. 2. The if (verbose) sess->act_log pattern leads to an excessive level of indentation, which tends to make things more unclear. What do you think? Signed-off-by: C

[PATCHv2] cldc: replace CLD_MAX_DATA_SZ with CLD_MAX_MSG_SZ

2009-12-06 Thread Colin McCabe
CLD_MAX_MSG_SZ is clearly the right constant to use when checking if a message the api user wants to send is too long. Signed-off-by: Colin McCabe --- lib/cldc.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/lib/cldc.c b/lib/cldc.c index 7fe5214..0ab4f19 100644

Re: [PATCH] cldc: replace CLD_MAX_DATA_SZ with CLD_MAX_MSG_SZ

2009-12-06 Thread Colin McCabe
D'oh! Resending. C. On Sun, Dec 6, 2009 at 12:46 PM, Jeff Garzik wrote: > On 12/06/2009 07:37 AM, Colin McCabe wrote: >> >> CLD_MAX_MSG_SZ is clearly the right constant to use when checking if a >> message >> the api user wants to send is too long. >> &g

[PATCH] cldc: replace CLD_MAX_DATA_SZ with CLD_MAX_MSG_SZ

2009-12-06 Thread Colin McCabe
CLD_MAX_MSG_SZ is clearly the right constant to use when checking if a message the api user wants to send is too long. I found this while working on the XDR stuff. --- lib/cldc.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/lib/cldc.c b/lib/cldc.c index 7fe5214..0a

[PATCH v3 2/2] cld: read the cld.port file using g_file_get_contents

2009-11-28 Thread Colin McCabe
Signed-off-by: Colin McCabe --- lib/common.c | 27 +-- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lib/common.c b/lib/common.c index 68f60f8..f139de0 100644 --- a/lib/common.c +++ b/lib/common.c @@ -61,26 +61,25 @@ const char *cld_errstr(enum

[PATCH v2 2/2] cld: read the cld.port file using g_file_get_contents

2009-11-28 Thread Colin McCabe
Signed-off-by: Colin McCabe --- lib/common.c | 29 +++-- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/common.c b/lib/common.c index 68f60f8..db20e2a 100644 --- a/lib/common.c +++ b/lib/common.c @@ -1,4 +1,5 @@ +#include #include #include

[PATCH v2 1/2] cld: in tests, call g_thread_init before cld_init

2009-11-28 Thread Colin McCabe
From: cmccabe Signed-off-by: Colin McCabe --- test/it-works.c|1 + test/load-file-event.c |1 + test/lock-file-event.c |1 + test/save-file-event.c |1 + 4 files changed, 4 insertions(+), 0 deletions(-) diff --git a/test/it-works.c b/test/it-works.c index bd2f965

Re: [PATCH v2 1/2] cld: in tests, call g_thread_init before cld_init

2009-11-28 Thread Colin McCabe
Oops... please ignore the From: line. C. On Fri, Nov 27, 2009 at 6:21 PM, Colin McCabe wrote: > From: cmccabe > > Signed-off-by: Colin McCabe > > --- > test/it-works.c|1 + > test/load-file-event.c |1 + > test/lock-file-event.c |1 + > te

Re: [PATCH] Some minor CLD test program fixes

2009-11-28 Thread Colin McCabe
On Sat, Nov 28, 2009 at 1:23 AM, Jeff Garzik wrote: > On 11/27/2009 06:20 PM, cmcc...@alumni.cmu.edu wrote: >> >> --- a/lib/common.c >> +++ b/lib/common.c >> @@ -56,6 +56,37 @@ const char *cld_errstr(enum cle_err_codes ecode) >>return cld_errlist[ecode]; >> } >> >> +/** Read from a file d