Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deprecated API usage in boiler_plate example #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/boiler_plate/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void initialize_cli(int argc, char const *argv[]) {
if (fio_cli_get("-redis") && strlen(fio_cli_get("-redis"))) {
FIO_LOG_INFO("* Initializing Redis connection to %s\n",
fio_cli_get("-redis"));
http_url_s info =
fio_url_s info =
utoni marked this conversation as resolved.
Show resolved Hide resolved
http_url_parse(fio_cli_get("-redis"), strlen(fio_cli_get("-redis")));
fio_pubsub_engine_s *e =
redis_engine_create(.address = info.host, .port = info.port,
Expand Down
6 changes: 5 additions & 1 deletion lib/facil/http/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,11 @@ typedef fio_url_s http_url_s
*
* Invalid formats might produce unexpected results. No error testing performed.
*/
#define http_url_parse(url, len) fio_url_parse((url), (len))
static inline fio_url_s __attribute__((deprecated("use fio_url_parse instead")))
http_url_parse(const char *url, size_t length)
{
return fio_url_parse(url, length);
}

#if DEBUG
void http_tests(void);
Expand Down
4 changes: 2 additions & 2 deletions lib/facil/http/parsers/http1_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,13 +583,13 @@ size_t http1_fio_parser_fn(struct http1_fio_parser_args_s *args) {
: args->on_request)(args->parser))
goto error;
args->parser->state =
(struct http1_parser_protected_read_only_state_s){0, 0, 0};
(struct http1_parser_protected_read_only_state_s){0, 0, 0, 0};
}
return CONSUMED;
error:
args->on_error(args->parser);
args->parser->state =
(struct http1_parser_protected_read_only_state_s){0, 0, 0};
(struct http1_parser_protected_read_only_state_s){0, 0, 0, 0};
return args->length;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/facil/tls/fio_tls_missing.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ ALPN Helpers

/** Returns a pointer to the ALPN data (callback, etc') IF exists in the TLS. */
FIO_FUNC inline alpn_s *alpn_find(fio_tls_s *tls, char *name, size_t len) {
alpn_s tmp = {.name = FIO_STR_INIT_STATIC2(name, len)};
alpn_s tmp = {.name = FIO_STR_INIT_STATIC2(name, len), NULL, NULL, NULL};
alpn_list__map_s_ *pos =
alpn_list__find_map_pos_(&tls->alpn, fio_str_hash(&tmp.name), tmp);
if (!pos || !pos->pos)
Expand Down