diff --git a/build/htdocs/.DS_Store b/build/htdocs/.DS_Store index 5cbae99..35bd7b1 100755 Binary files a/build/htdocs/.DS_Store and b/build/htdocs/.DS_Store differ diff --git a/build/htdocs/scripts/.DS_Store b/build/htdocs/scripts/.DS_Store index 5008ddf..9dd6f6e 100644 Binary files a/build/htdocs/scripts/.DS_Store and b/build/htdocs/scripts/.DS_Store differ diff --git a/http_server.c b/http_server.c index ab00d08..dd3a9b6 100644 --- a/http_server.c +++ b/http_server.c @@ -137,11 +137,11 @@ void cat(int client, FILE *resource) { char buf[1024]; - fgets(buf, sizeof(buf), resource); - while (!feof(resource)) + //fgets(buf, sizeof(buf), resource); + while (fgets(buf, sizeof(buf), resource) != NULL) { send(client, buf, strlen(buf), 0); - fgets(buf, sizeof(buf), resource); + //fgets(buf, sizeof(buf), resource); } diff --git a/plugin_manager.c b/plugin_manager.c index 9873114..2ff8542 100644 --- a/plugin_manager.c +++ b/plugin_manager.c @@ -196,17 +196,21 @@ dictionary decode_cookie(const char* line) { char *token,*token1; char *cpstr = strdup(line); + trim(cpstr,' '); + trim(cpstr,'\n'); + trim(cpstr,'\r'); + //printf("FUCKIT %s\n",cpstr ); dictionary dic = NULL; while((token = strsep(&cpstr,";"))) { + trim(token,' '); token1 = strsep(&token,"="); if(token1) { if(dic == NULL) dic = dict(); - LOG("Found cookie : %s = %s\n",token1,token); - trim(token1,' '); - dput(dic,token1,token); + //LOG("Found cookie : %s = %s\n",token1,token); + dput(dic,token1,strdup(token)); } } //} diff --git a/plugins/plugin.c b/plugins/plugin.c index 100bcd0..e7cc3fc 100644 --- a/plugins/plugin.c +++ b/plugins/plugin.c @@ -200,12 +200,13 @@ int __f(int client, const char* file) LOG("Cannot read : %s\n", file); return 0; } - fgets(buf, sizeof(buf), ptr); - while(!feof(ptr)) + ; + while(fgets(buf, sizeof(buf), ptr) != NULL) { nbytes = send(client, buf, strlen(buf), 0); if(nbytes == -1) return 0; - fgets(buf, sizeof(buf), ptr); + //LOG("READ : %s\n", buf); + //fgets(buf, sizeof(buf), ptr); } fclose(ptr); return 1;