Changed parameters and arguments.

yamux
Jose Marcial Vieira Bisneto 2017-09-22 11:52:31 -03:00
parent d872fb079d
commit 0b45b25d6e
No known key found for this signature in database
GPG Key ID: 103E935E7E6E831E
1 changed files with 7 additions and 5 deletions

View File

@ -362,16 +362,18 @@ struct HttpRequest* api_build_http_request(struct s_request* req) {
}
value = strchr(name, '=');
if (value) { // with = assuming params.
if (value) {
*value++ = '\0';
}
if (value && (strcmp(name, "arg")==0)) {
libp2p_utils_vector_add(request->arguments, value);
} else {
struct HttpParam *hp = ipfs_core_http_param_new();
if (hp) {
*value++ = '\0';
hp->name = name;
hp->value = value;
hp->value = value; // maybe null ?
libp2p_utils_vector_add(request->params, hp);
}
} else { // without =, assuming arguments
libp2p_utils_vector_add(request->arguments, name);
}
}
}