summaryrefslogtreecommitdiffstats
path: root/client-fn.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-10-03 12:34:16 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-10-03 12:34:16 +0000
commitfe06744d66e66b0b8e3839dbca5791001be5e58d (patch)
tree8dc1240b8d30e8ccd85fc2fd6b58633ec7dc349e /client-fn.c
parentdadc56d754f2e86dec96bcf3bed54090538ce336 (diff)
String/number arguments..
Diffstat (limited to 'client-fn.c')
-rw-r--r--client-fn.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/client-fn.c b/client-fn.c
index 8aecd463..37fde7a1 100644
--- a/client-fn.c
+++ b/client-fn.c
@@ -1,4 +1,4 @@
-/* $Id: client-fn.c,v 1.1 2007-10-03 10:18:31 nicm Exp $ */
+/* $Id: client-fn.c,v 1.2 2007-10-03 12:34:16 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -62,6 +62,23 @@ client_write_server(
hdr.type = type;
hdr.size = len;
buffer_write(cctx->srv_out, &hdr, sizeof hdr);
- if (len > 0)
+
+ if (buf != NULL)
buffer_write(cctx->srv_out, buf, len);
}
+
+void
+client_write_server2(struct client_ctx *cctx,
+ enum hdrtype type, void *buf1, size_t len1, void *buf2, size_t len2)
+{
+ struct hdr hdr;
+
+ hdr.type = type;
+ hdr.size = len1 + len2;
+ buffer_write(cctx->srv_out, &hdr, sizeof hdr);
+
+ if (buf1 != NULL)
+ buffer_write(cctx->srv_out, buf1, len1);
+ if (buf2 != NULL)
+ buffer_write(cctx->srv_out, buf2, len2);
+}