aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-04-15 16:05:28 +0200
committertomsmeding <tom.smeding@gmail.com>2017-04-15 16:05:28 +0200
commit3b3f2f3168c80e53055891f9afcfc5c5120dabd7 (patch)
tree415c701933364f283f8eadac1bb0e0543f9fb97f /net.c
parent9800ecb1e93d398988a6904d5e4dc6c4e11aedb0 (diff)
server: Support cmd_is_online
Diffstat (limited to 'net.c')
-rw-r--r--net.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net.c b/net.c
index e5bdb6b..cce4dc6 100644
--- a/net.c
+++ b/net.c
@@ -27,6 +27,14 @@ bool net_send_ok(int fd,const char *tag){
return closed;
}
+bool net_send_number(int fd,const char *tag,i64 number){
+ char *buf=NULL;
+ i64 len=asprintf(&buf,"%s number %" PRIi64 "\n",tag,number);
+ bool closed=net_send_raw_text(fd,buf,len);
+ free(buf);
+ return closed;
+}
+
bool net_send_error(int fd,const char *tag,const char *msg){
char *buf=NULL;
i64 len=asprintf(&buf,"%s error %s\n",tag,msg);