Changeset 3ba63c


Ignore:
Timestamp:
2010-02-01 11:36:52 (4 years ago)
Author:
Poul-Henning Kamp <phk@…>
Branches:
master, 3.0, 4.0, experimental-ims
Children:
63f3e2
Parents:
3ea28b
git-author:
Poul-Henning Kamp <phk@…> (2010-02-01 11:36:52)
git-committer:
Poul-Henning Kamp <phk@…> (2010-02-01 11:36:52)
Message:

Don't assert on write errors to the child process CLI-pipe, it might
simply be dying on us. Instead return the designed error code for
this: CLIS_COMM

Fixes #639

git-svn-id:  http://www.varnish-cache.org/svn/trunk/varnish-cache@4517 d4fa192b-c00b-0410-8231-f00ffab90ce4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/varnishd/mgt_cli.c

    r10c90c r3ba63c  
    176176        AN(cli->cmd); 
    177177        i = write(cli_o, cli->cmd, strlen(cli->cmd)); 
    178         xxxassert(i == strlen(cli->cmd)); 
     178        if (i != strlen(cli->cmd)) { 
     179                cli_result(cli, CLIS_COMMS); 
     180                cli_out(cli, "CLI communication error"); 
     181                return; 
     182        } 
    179183        i = write(cli_o, "\n", 1); 
    180         xxxassert(i == 1); 
     184        if (i != 1) { 
     185                cli_result(cli, CLIS_COMMS); 
     186                cli_out(cli, "CLI communication error"); 
     187                return; 
     188        } 
     189                 
     190        assert(i == 1 || errno == EPIPE); 
    181191        (void)cli_readres(cli_i, 
    182192            &u, &q, params->cli_timeout); 
Note: See TracChangeset for help on using the changeset viewer.