{"action":"created","issue":{"url":"https://api.github.com/repos/embedthis/appweb/issues/539","labels_url":"https://api.github.com/repos/embedthis/appweb/issues/539/labels{/name}","comments_url":"https://api.github.com/repos/embedthis/appweb/issues/539/comments","events_url":"https://api.github.com/repos/embedthis/appweb/issues/539/events","html_url":"https://github.com/embedthis/appweb/issues/539","id":112856040,"number":539,"title":"ROM file system support does not work at all","user":{"login":"rks2003","id":15252432,"avatar_url":"https://avatars.githubusercontent.com/u/15252432?v=3","gravatar_id":"","url":"https://api.github.com/users/rks2003","html_url":"https://github.com/rks2003","followers_url":"https://api.github.com/users/rks2003/followers","following_url":"https://api.github.com/users/rks2003/following{/other_user}","gists_url":"https://api.github.com/users/rks2003/gists{/gist_id}","starred_url":"https://api.github.com/users/rks2003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rks2003/subscriptions","organizations_url":"https://api.github.com/users/rks2003/orgs","repos_url":"https://api.github.com/users/rks2003/repos","events_url":"https://api.github.com/users/rks2003/events{/privacy}","received_events_url":"https://api.github.com/users/rks2003/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-22T17:52:18Z","updated_at":"2015-10-23T08:26:15Z","closed_at":null,"body":"with Appweb 6.1 and earlier versions\r\n\r\n1) makerom.c is not included in appweb 5.x & 6.x (but in 3.x & 4.x)\r\n\r\n2) Compile error in httpLib.c, if ME_ROM is defined (missing return value while function should return an int):\r\n PUBLIC int httpSendOpen(HttpQueue *q) { }\r\n \r\n3) Appweb crashes after calling mprCreate in mprGetAbsPath, if ME_ROM is defined\r\nbecause fs is used while not initialized:\r\n...\r\n#if ME_ROM\r\n    result =  mprNormalizePath(path);\r\n    mprMapSeparators(result, defaultSep(fs));\r\n    return result;\r\n#elif CYGWIN\r\n...\r\n\r\n4) wrong validations of relativ/absolut path names in Windows (C:\\ expected) and Linux (/ expected), e.g. in httpSetFilename() while makerom does not support absolute paths \r\n\r\n5) On Linux, mprGetRelPath changes the path from \"index.html\" to something like \"../../../../../../index.html\" if ME_ROM is defined \r\n\r\n6) ROM hash table not working if romfiles.c contains multiple large files (results in file not found)\r\n"},"comment":{"url":"https://api.github.com/repos/embedthis/appweb/issues/comments/150510689","html_url":"https://github.com/embedthis/appweb/issues/539#issuecomment-150510689","issue_url":"https://api.github.com/repos/embedthis/appweb/issues/539","id":150510689,"user":{"login":"rks2003","id":15252432,"avatar_url":"https://avatars.githubusercontent.com/u/15252432?v=3","gravatar_id":"","url":"https://api.github.com/users/rks2003","html_url":"https://github.com/rks2003","followers_url":"https://api.github.com/users/rks2003/followers","following_url":"https://api.github.com/users/rks2003/following{/other_user}","gists_url":"https://api.github.com/users/rks2003/gists{/gist_id}","starred_url":"https://api.github.com/users/rks2003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rks2003/subscriptions","organizations_url":"https://api.github.com/users/rks2003/orgs","repos_url":"https://api.github.com/users/rks2003/repos","events_url":"https://api.github.com/users/rks2003/events{/privacy}","received_events_url":"https://api.github.com/users/rks2003/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T08:26:15Z","updated_at":"2015-10-23T08:26:15Z","body":"1) OK thank you. But it would be very helpful to add a hint to your appweb documentation were to find the tool.\r\n\r\n4 & 5) I've changed the code in httpSetFilename\r\n\r\n#ifndef ME_ROM\r\n    if (!(tx->flags & HTTP_TX_NO_CHECK)) {\r\n        if (!mprIsAbsPathContained(filename, conn->rx->route->documents)) {\r\n            info->checked = 1;\r\n            info->valid = 0;\r\n            httpError(conn, HTTP_CODE_BAD_REQUEST, \"Filename outside published documents\");\r\n            return 0;\r\n        }\r\n    }\r\n#else\r\n    while ((((char*)filename)[0] == '/') || (((char*)filename)[0] == '\\\\'))\r\n    {\r\n       memmove((char*)filename, (char*)(filename+1), strlen(filename));\r\n    }\r\n#endif\r\n\r\nadded #ifndef ME_ROM around the if statement [ (if (!(tx->flags & HTTP_TX_NO_CHECK)) { ]\r\nto solve 4)\r\nand added the #else to solve 5)\r\nbut I'm pretty sure that this are only workarounds!\r\n\r\nwithout this changes ROM support does not work. I've tried to configure the server in different ways like maConfigureServer(NULL, \"/\", \"/\", \"0.0.0.0\", 80); or maConfigureServer(NULL, \".\", \".\", \"0.0.0.0\", 80); or maConfigureServer(NULL, \"\", \"\", \"0.0.0.0\", 80);\r\n\r\nnow (with the above changes) maConfigureServer(NULL, \"/\", \"/\", \"0.0.0.0\", 80); works for me\r\n\r\n6) found the reason\r\nUnder windows the given path in the function call \"static MprRomInode *lookup(MprRomFileSystem *rfs, cchar *path)\" is something like \"kendo\\examples\\grid\\editing.html\" with '\\' but my romfiles.c contains '/'. Accessing the rom files works fine if the server runs on a linux machine but not on windows.\r\n\r\nPUBLIC MprRomInode romFiles[] = {\r\n    { \"\", 0, 0, 0 },\r\n    { \"conf/server.conf\", _file_2, 2489, 2 },\r\n    { \"index.html\", _file_3, 11, 3 },\r\n    { \"kendo/examples/content/shared/js/console.js\", _file_4, 4444, 4 },\r\n    { \"kendo/examples/content/shared/styles/examples-offline.css\", _file_5, 11657, 5 },\r\n    { \"kendo/examples/grid/editing.html\", _file_6, 4116, 6 },\r\n    { \"kendo/js/jquery.min.js\", _file_7, 92629, 7 },\r\n    { \"kendo/js/kendo.all.min.js\", _file_8, 2491892, 8 },\r\n    { \"kendo/styles/kendo.common.min.css\", _file_9, 243472, 9 },\r\n    { \"kendo/styles/kendo.dataviz.default.min.css\", _file_10, 333, 10 },\r\n    { \"kendo/styles/kendo.dataviz.min.css\", _file_11, 333, 11 },\r\n    { \"kendo/styles/kendo.default.min.css\", _file_12, 59050, 12 },\r\n    { \"kendo/styles/kendo.rtl.min.css\", _file_13, 12655, 13 },\r\n    { 0, 0, 0, 0 },\r\n};\r\n\r\n7) it would be helpful to support something like mprSetLogHandler for the http trace, e.g. because the traceLogDirective is not supported if using ROM files.\r\n"}}