- PARA_DEBUG_LOG("checking %s\n", ra);
- for (j = 0; receivers[j].name; j++) {
- const char *name = receivers[j].name;
- size_t len = strlen(name);
- char c;
- if (strlen(ra) < len)
- continue;
- if (strncmp(name, ra, len))
- continue;
- c = ra[len];
- if (c && c != ' ')
- continue;
- if (c && !receivers[j].parse_config)
- return NULL;
- *receiver_num = j;
- return parse_receiver_args(j, c? ra + len + 1: NULL);
+ *lprp = NULL;
+ if (!ra || !*ra) {
+ argc = 1;
+ argv = para_malloc(2 * sizeof(char*));
+ argv[0] = para_strdup("http");
+ argv[1] = NULL;
+ } else {
+ ret = create_argv(ra, " \t\n", &argv);
+ if (ret < 0) {
+ PARA_EMERG_LOG("%s\n", para_strerror(-ret));
+ exit(EXIT_FAILURE);
+ }
+ argc = ret;
+ }
+ ret = lls(lls_lookup_subcmd(argv[0], recv_cmd_suite, &errctx));
+ if (ret < 0) {
+ PARA_EMERG_LOG("%s: %s\n", errctx? errctx : argv[0],
+ para_strerror(-ret));
+ exit(EXIT_FAILURE);
+ }
+ receiver_num = ret;
+ cmd = RECV_CMD(receiver_num);
+ ret = lls(lls_parse(argc, argv, cmd, lprp, &errctx));
+ if (ret < 0) {
+ if (errctx)
+ PARA_ERROR_LOG("%s\n", errctx);
+ PARA_EMERG_LOG("%s\n", para_strerror(-ret));
+ exit(EXIT_FAILURE);