X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hsrv.c;h=61e5c3c2e7a361315a387e5bd9d89dacb94f8d56;hb=65353dce81a629e042800bb7b86fcd869a76727e;hp=ed0adeeb69b9195f3daac178b48abdfd849ab7a9;hpb=d7e4faba5d1744160d538edd74bc4bdd8a173b1a;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c index ed0adeeb..61e5c3c2 100644 --- a/src/afb-hsrv.c +++ b/src/afb-hsrv.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2019 "IoT.bzh" + * Copyright (C) 2015-2020 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +56,7 @@ struct hsrv_itf { struct hsrv_itf *next; struct afb_hsrv *hsrv; struct fdev *fdev; - char uri[1]; + char uri[]; }; struct hsrv_handler { @@ -533,7 +533,7 @@ static int hsrv_itf_connect(struct hsrv_itf *itf) char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV]; int rgni; - itf->fdev = afb_socket_open_fdev(itf->uri, 1); + itf->fdev = afb_socket_open_fdev_scheme(itf->uri, 1, "tcp"); if (!itf->fdev) { ERROR("can't create socket %s", itf->uri); return 0; @@ -562,7 +562,7 @@ int afb_hsrv_add_interface(struct afb_hsrv *hsrv, const char *uri) { struct hsrv_itf *itf; - itf = malloc(sizeof *itf + strlen(uri)); + itf = malloc(sizeof *itf + 1 + strlen(uri)); if (itf == NULL) return -1;