filters/delay/delay.c
/* Called for each key=value passed on the command line. */
Called for each key=value passed on the command line.
Called for each key = value passed on the command line .
static int
delay_config (nbdkit_next_config *next, void *nxdata,
              const char *key, const char *value)
{
  if (strcmp (key, "rdelay") == 0 ||
      strcmp (key, "delay-read") == 0 ||
      strcmp (key, "delay-reads") == 0) {
    delay_read_ms = parse_delay (key, value);
    if (delay_read_ms == -1)
      return -1;
    return 0;
  }
  else if (strcmp (key, "wdelay") == 0) {
    delay_write_ms = parse_delay (key, value);
    if (delay_write_ms == -1)
      return -1;
    delay_zero_ms = delay_trim_ms = delay_write_ms;
    return 0;
  }
  else if (strcmp (key, "delay-write") == 0 ||
           strcmp (key, "delay-writes") == 0) {
    delay_write_ms = parse_delay (key, value);
    if (delay_write_ms == -1)
      return -1;
    return 0;
  }
  else if (strcmp (key, "delay-zero") == 0 ||
           strcmp (key, "delay-zeroes") == 0) {
    delay_zero_ms = parse_delay (key, value);
    if (delay_zero_ms == -1)
      return -1;
    return 0;
  }
  else if (strcmp (key, "delay-trim") == 0 ||
           strcmp (key, "delay-trims") == 0 ||
           strcmp (key, "delay-discard") == 0 ||
           strcmp (key, "delay-discards") == 0) {
    delay_trim_ms = parse_delay (key, value);
    if (delay_trim_ms == -1)
      return -1;
    return 0;
  }
  else
    return next (nxdata, key, value);
}
static int delay_config ( nbdkit_next_config * next , void * nxdata , const char * key , const char * value ) { if ( strcmp ( key , " " ) == 0 || strcmp ( key , " " ) == 0 || strcmp ( key , " " ) == 0 ) { delay_read_ms = parse_delay ( key , value ) ; if ( delay_read_ms == -1 ) return -1 ; return 0 ; } else if ( strcmp ( key , " " ) == 0 ) { delay_write_ms = parse_delay ( key , value ) ; if ( delay_write_ms == -1 ) return -1 ; delay_zero_ms = delay_trim_ms = delay_write_ms ; return 0 ; } else if ( strcmp ( key , " " ) == 0 || strcmp ( key , " " ) == 0 ) { delay_write_ms = parse_delay ( key , value ) ; if ( delay_write_ms == -1 ) return -1 ; return 0 ; } else if ( strcmp ( key , " " ) == 0 || strcmp ( key , " " ) == 0 ) { delay_zero_ms = parse_delay ( key , value ) ; if ( delay_zero_ms == -1 ) return -1 ; return 0 ; } else if ( strcmp ( key , " " ) == 0 || strcmp ( key , " " ) == 0 || strcmp ( key , " " ) == 0 || strcmp ( key , " " ) == 0 ) { delay_trim_ms = parse_delay ( key , value ) ; if ( delay_trim_ms == -1 ) return -1 ; return 0 ; } else return next ( nxdata , key , value ) ; }
Called for each key=value passed on the command line.
Called for each key = value passed on the command line .
/* Historically wdelay set all write-related delays. */