##// END OF EJS Templates
chg: provide early exception to user...
Yuya Nishihara -
r28512:b957b4c6 default
parent child Browse files
Show More
@@ -311,9 +311,16 b' static void readhello(hgclient_t *hgc)'
311 {
311 {
312 readchannel(hgc);
312 readchannel(hgc);
313 context_t *ctx = &hgc->ctx;
313 context_t *ctx = &hgc->ctx;
314 if (ctx->ch != 'o')
314 if (ctx->ch != 'o') {
315 abortmsg("unexpected channel of hello message (ch = %c)",
315 char ch = ctx->ch;
316 ctx->ch);
316 if (ch == 'e') {
317 /* write early error and will exit */
318 fwrite(ctx->data, sizeof(ctx->data[0]), ctx->datasize,
319 stderr);
320 handleresponse(hgc);
321 }
322 abortmsg("unexpected channel of hello message (ch = %c)", ch);
323 }
317 enlargecontext(ctx, ctx->datasize + 1);
324 enlargecontext(ctx, ctx->datasize + 1);
318 ctx->data[ctx->datasize] = '\0';
325 ctx->data[ctx->datasize] = '\0';
319 debugmsg("hello received: %s (size = %zu)", ctx->data, ctx->datasize);
326 debugmsg("hello received: %s (size = %zu)", ctx->data, ctx->datasize);
General Comments 0
You need to be logged in to leave comments. Login now