X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hreq.c;h=5eb0cc566512b0eedbd62aa3529099350002dd0f;hb=7ea1657b459aea2cc6ef9332621a19d7e2676b1d;hp=518bc5cb50eb59ed1723f44c2429b3f979314d53;hpb=f1b901ed676b2d45ec8e6ae3d6ef2f94d79f9ee6;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hreq.c b/src/afb-hreq.c index 518bc5cb..5eb0cc56 100644 --- a/src/afb-hreq.c +++ b/src/afb-hreq.c @@ -234,18 +234,15 @@ static magic_t lazy_libmagic() done = 1; /* MAGIC_MIME tells magic to return a mime of the file, but you can specify different things */ - if (verbosity) - fprintf(stderr, "Loading mimetype default magic database\n"); - + INFO("Loading mimetype default magic database"); result = magic_open(MAGIC_MIME_TYPE); if (result == NULL) { - fprintf(stderr,"ERROR: unable to initialize magic library\n"); + ERROR("unable to initialize magic library"); } /* Warning: should not use NULL for DB [libmagic bug wont pass efence check] */ else if (magic_load(result, MAGIC_DB) != 0) { - fprintf(stderr,"cannot load magic database - %s\n", - magic_error(result)); + ERROR("cannot load magic database: %s", magic_error(result)); magic_close(result); result = NULL; } @@ -435,8 +432,7 @@ int afb_hreq_reply_file_if_exist(struct afb_hreq *hreq, int dirfd, const char *f if (inm && 0 == strcmp(inm, etag)) { /* etag ok, return NOT MODIFIED */ close(fd); - if (verbosity) - fprintf(stderr, "Not Modified: [%s]\n", filename); + DEBUG("Not Modified: [%s]", filename); response = MHD_create_response_from_buffer(0, empty_string, MHD_RESPMEM_PERSISTENT); status = MHD_HTTP_NOT_MODIFIED; } else { @@ -477,8 +473,7 @@ int afb_hreq_redirect_to(struct afb_hreq *hreq, const char *url) { afb_hreq_reply_static(hreq, MHD_HTTP_MOVED_PERMANENTLY, 0, NULL, MHD_HTTP_HEADER_LOCATION, url, NULL); - if (verbosity) - fprintf(stderr, "redirect from [%s] to [%s]\n", hreq->url, url); + DEBUG("redirect from [%s] to [%s]", hreq->url, url); return 1; }