X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fhttp-svc.c;h=839fc2ffc9620d13270b69d697841fab3b0391dc;hb=c4ec16f3868b099f2904b54be78bcd09d3760a24;hp=ac0606eb924bd127222ae10b27b4a13b4cc2cfe1;hpb=a644a48c2dfdc4ba5129aa3b85a21aadc429f65d;p=src%2Fapp-framework-binder.git diff --git a/src/http-svc.c b/src/http-svc.c index ac0606eb..839fc2ff 100644 --- a/src/http-svc.c +++ b/src/http-svc.c @@ -249,7 +249,7 @@ STATIC int newRequest(void *cls, } // Nothing respond to this request Files, API, Angular Base - const char *errorstr = "Alsa-Json-Gateway Unknown or Not readable file"; + const char *errorstr = "AFB-Daemon File Not Find file"; response = MHD_create_response_from_buffer(strlen(errorstr), (void*)errorstr, MHD_RESPMEM_PERSISTENT); ret = MHD_queue_response(connection, MHD_HTTP_INTERNAL_SERVER_ERROR, response); return (MHD_YES); @@ -267,9 +267,12 @@ PUBLIC AFB_error httpdStart(AFB_session *session) { apiUrlLen = strlen (session->config->rootapi); baseUrlLen= strlen (session->config->rootbase); rootUrlLen= strlen (session->config->rootdir); + + // Initialise Client Session Hash Table + ctxStoreInit (CTX_NBCLIENTS); - // TBD open libmagic cache [fail to pass EFENCE check] - // initLibMagic (session); + //TBD open libmagic cache [fail to pass EFENCE check (allocating 0 bytes)] + //initLibMagic (session); if (verbose) { @@ -295,20 +298,11 @@ PUBLIC AFB_error httpdStart(AFB_session *session) { // infinite loop PUBLIC AFB_error httpdLoop(AFB_session *session) { - static int count = 0; - + int count = 0; if (verbose) fprintf(stderr, "AFB:notice entering httpd waiting loop\n"); - if (session->foreground) { - - while (TRUE) { - fprintf(stderr, "AFB:notice Use Ctrl-C to quit\n"); - (void) getc(stdin); - } - } else { - while (TRUE) { - sleep(3600); - if (verbose) fprintf(stderr, "AFB:notice httpd alive [%d]\n", count++); - } + while (TRUE) { + sleep(3600); + if (verbose) fprintf(stderr, "AFB:notice httpd alive [%d]\n", count++); } // should never return from here