##// END OF EJS Templates
chg: handle pager request client-side...
Jun Wu -
r30738:a45c0f42 default
parent child Browse files
Show More
@@ -25,7 +25,7 b' all: $(TARGET)'
25 $(CC) $(LDFLAGS) -o $@ $(OBJS)
25 $(CC) $(LDFLAGS) -o $@ $(OBJS)
26
26
27 chg.o: hgclient.h procutil.h util.h
27 chg.o: hgclient.h procutil.h util.h
28 hgclient.o: hgclient.h util.h
28 hgclient.o: hgclient.h procutil.h util.h
29 procutil.o: procutil.h util.h
29 procutil.o: procutil.h util.h
30 util.o: util.h
30 util.o: util.h
31
31
@@ -23,6 +23,7 b''
23 #include <unistd.h>
23 #include <unistd.h>
24
24
25 #include "hgclient.h"
25 #include "hgclient.h"
26 #include "procutil.h"
26 #include "util.h"
27 #include "util.h"
27
28
28 enum {
29 enum {
@@ -71,6 +72,8 b' struct hgclient_tag_ {'
71
72
72 static const size_t defaultdatasize = 4096;
73 static const size_t defaultdatasize = 4096;
73
74
75 static void attachio(hgclient_t *hgc);
76
74 static void initcontext(context_t *ctx)
77 static void initcontext(context_t *ctx)
75 {
78 {
76 ctx->ch = '\0';
79 ctx->ch = '\0';
@@ -248,6 +251,13 b' static void handlesystemrequest(hgclient'
248 memcpy(ctx->data, &r_n, sizeof(r_n));
251 memcpy(ctx->data, &r_n, sizeof(r_n));
249 ctx->datasize = sizeof(r_n);
252 ctx->datasize = sizeof(r_n);
250 writeblock(hgc);
253 writeblock(hgc);
254 } else if (strcmp(args[0], "pager") == 0) {
255 setuppager(args[1]);
256 if (hgc->capflags & CAP_ATTACHIO)
257 attachio(hgc);
258 /* unblock the server */
259 static const char emptycmd[] = "\n";
260 sendall(hgc->sockfd, emptycmd, sizeof(emptycmd) - 1);
251 } else {
261 } else {
252 abortmsg("unknown type in system request: %s", args[0]);
262 abortmsg("unknown type in system request: %s", args[0]);
253 }
263 }
General Comments 0
You need to be logged in to leave comments. Login now