plugins/curl/curl.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
curl_config (const char *key, const char *value)
{
  if (strcmp (key, "url") == 0)
    url = value;
  else if (strcmp (key, "user") == 0)
    user = value;
  else if (strcmp (key, "password") == 0) {
    free (password);
    if (nbdkit_read_password (value, &password) == -1)
      return -1;
  }
  else if (strcmp (key, "sslverify") == 0) {
    if (sscanf (value, "%d", &sslverify) != 1) {
      nbdkit_error ("'sslverify' must be 0 or 1");
      return -1;
    }
  }
  else if (strcmp (key, "timeout") == 0) {
    if (sscanf (value, "%d", &timeout) != 1 || timeout < 0) {
      nbdkit_error ("'timeout' must be 0 or a positive timeout in seconds");
      return -1;
    }
  }
  else if (strcmp (key, "unix_socket_path") == 0)
    unix_socket_path = value;
  else {
    nbdkit_error ("unknown parameter '%s'", key);
    return -1;
  }
  return 0;
}
static int curl_config ( const char * key , const char * value ) { if ( strcmp ( key , " " ) == 0 ) url = value ; else if ( strcmp ( key , " " ) == 0 ) user = value ; else if ( strcmp ( key , " " ) == 0 ) { free ( password ) ; if ( nbdkit_read_password ( value , & password ) == -1 ) return -1 ; } else if ( strcmp ( key , " " ) == 0 ) { if ( sscanf ( value , " " , & sslverify ) != 1 ) { nbdkit_error ( " " ) ; return -1 ; } } else if ( strcmp ( key , " " ) == 0 ) { if ( sscanf ( value , " " , & timeout ) != 1 || timeout < 0 ) { nbdkit_error ( " " ) ; return -1 ; } } else if ( strcmp ( key , " " ) == 0 ) unix_socket_path = value ; else { nbdkit_error ( " " , key ) ; return -1 ; } return 0 ; }
Called for each key=value passed on the command line.
Called for each key = value passed on the command line .