Wapp

Artifact Content
Login

Artifact 3ea08819cccd5bac7083d06413c6c250377f16139379eaa7317ede62afc272ef:

Ticket change [3ea08819cc] - Ticket [207094dd9de1343a|207094dd9d] <i>Multiple request in progress can step on each others toes</i> status still Open with 5 other changes by mjanssen 2019-07-30 10:29:17.
D 2019-07-30T10:29:17.280
J icomment diff\s--git\sa/modules/wapp-1.0.tm\sb/modules/wapp-1.0.tm\r\nindex\s0467333..57888d1\s100644\r\n---\sa/modules/wapp-1.0.tm\r\n+++\sb/modules/wapp-1.0.tm\r\n@@\s-426,7\s+426,6\s@@\sproc\swappInt-start-browser\s{url}\s{\r\n\s#\srequest\sif\s$fromip\sis\snot\san\sempty\sstring\sand\sdoes\snot\smatch\s$ip.\r\n\s#\r\n\sproc\swappInt-new-connection\s{callback\swappmode\sfromip\schan\sip\sport}\s{\r\n-\s\supvar\s#0\swappInt-$chan\sW\r\n\s\s\sif\s{$fromip!=""\s&&\s![string\smatch\s$fromip\s$ip]}\s{\r\n\s\s\s\s\sclose\s$chan\r\n\s\s\s\s\sreturn\r\n@@\s-434,7\s+433,7\s@@\sproc\swappInt-new-connection\s{callback\swappmode\sfromip\schan\sip\sport}\s{\r\n\s\s\sset\sW\s[dict\screate\sREMOTE_ADDR\s$ip\sREMOTE_PORT\s$port\sWAPP_MODE\s$wappmode\s\\\r\n\s\s\s\s\s\s\s\s\s\s.header\s{}]\r\n\s\s\sfconfigure\s$chan\s-blocking\s0\s-translation\sbinary\r\n-\s\sfileevent\s$chan\sreadable\s[list\s$callback\s$chan]\r\n+\s\sfileevent\s$chan\sreadable\s[list\s$callback\s$W\s$chan]\r\n\s}\r\n\s\r\n\s#\sClose\san\sinput\schannel\r\n@@\s-444,21\s+443,20\s@@\sproc\swappInt-close-channel\s{chan}\s{\r\n\s\s\s\s\s#\sThis\shappens\safter\scompleting\sa\sCGI\srequest\r\n\s\s\s\s\sexit\s0\r\n\s\s\s}\selse\s{\r\n-\s\s\s\sunset\s::wappInt-$chan\r\n\s\s\s\s\sclose\s$chan\r\n\s\s\s}\r\n\s}\r\n\s\r\n\s#\sProcess\snew\stext\sreceived\son\san\sinbound\sHTTP\srequest\r\n\s#\r\n-proc\swappInt-http-readable\s{chan}\s{\r\n-\s\sif\s{[catch\s[list\swappInt-http-readable-unsafe\s$chan]\smsg]}\s{\r\n+proc\swappInt-http-readable\s{W\schan}\s{\r\n+\s\sif\s{[catch\s[list\swappInt-http-readable-unsafe\s$W\s$chan]\smsg]}\s{\r\n\s\s\s\s\sputs\sstderr\s"$msg\\n$::errorInfo"\r\n\s\s\s\s\swappInt-close-channel\s$chan\r\n\s\s\s}\r\n\s}\r\n-proc\swappInt-http-readable-unsafe\s{chan}\s{\r\n-\s\supvar\s#0\swappInt-$chan\sW\swapp\swapp\r\n+proc\swappInt-http-readable-unsafe\s{W\schan}\s{\r\n+\s\supvar\s#0\swapp\swapp\r\n\s\s\sif\s{![dict\sexists\s$W\s.toread]}\s{\r\n\s\s\s\s\s#\sIf\sthe\s.toread\skey\sis\snot\sset,\sthat\smeans\swe\sare\sstill\sreading\r\n\s\s\s\s\s#\sthe\sheader\r\n@@\s-481,10\s+479,7\s@@\sproc\swappInt-http-readable-unsafe\s{chan}\s{\r\n\s\s\s\s\s\s\s\s\sdict\sset\sW\sSCRIPT_FILENAME\s$a0\r\n\s\s\s\s\s\s\s\s\sdict\sset\sW\sDOCUMENT_ROOT\s[file\sdir\s$a0]\r\n\s\s\s\s\s\s\s}\r\n-\s\s\s\s\s\sif\s{[wappInt-parse-header\s$chan]}\s{\r\n-\s\s\s\s\s\s\s\scatch\s{close\s$chan}\r\n-\s\s\s\s\s\s\s\sreturn\r\n-\s\s\s\s\s\s}\r\n+\s\s\s\s\s\sset\sW\s[wappInt-parse-header\s$W]\s\r\n\s\s\s\s\s\s\sset\slen\s0\r\n\s\s\s\s\s\s\sif\s{[dict\sexists\s$W\sCONTENT_LENGTH]}\s{\r\n\s\s\s\s\s\s\s\s\sset\slen\s[dict\sget\s$W\sCONTENT_LENGTH]\r\n@@\s-496,6\s+491,7\s@@\sproc\swappInt-http-readable-unsafe\s{chan}\s{\r\n\s\s\s\s\s\s\s\s\s#\sThere\sis\sno\squery\scontent,\sso\shandle\sthe\srequest\simmediately\r\n\s\s\s\s\s\s\s\s\sset\swapp\s$W\r\n\s\s\s\s\s\s\s\s\swappInt-handle-request\s$chan\s0\r\n+\s\s\s\s\s\s\s\sreturn\r\n\s\s\s\s\s\s\s}\r\n\s\s\s\s\s}\r\n\s\s\s}\selse\s{\r\n@@\s-508,8\s+504,10\s@@\sproc\swappInt-http-readable-unsafe\s{chan}\s{\r\n\s\s\s\s\s\s\s#\sHandle\sthe\srequest\sas\ssoon\sas\sall\sthe\squery\scontent\sis\sreceived\r\n\s\s\s\s\s\s\sset\swapp\s$W\r\n\s\s\s\s\s\s\swappInt-handle-request\s$chan\s0\r\n-\s\s\s\s}\r\n+\s\s\s\s\s\sreturn\r\n+\s\s\s\s}\s\r\n\s\s\s}\r\n+\s\sfileevent\s$chan\sreadable\s[list\swappInt-http-readable\s$W\s$chan]\r\n\s}\r\n\s\r\n\s#\sDecode\sthe\sHTTP\srequest\sheader.\r\n@@\s-517,8\s+515,7\s@@\sproc\swappInt-http-readable-unsafe\s{chan}\s{\r\n\s#\sThis\sroutine\sis\salways\srunning\sinside\sof\sa\s[catch],\sso\sif\r\n\s#\sany\sproblems\sarise,\ssimply\sraise\san\serror.\r\n\s#\r\n-proc\swappInt-parse-header\s{chan}\s{\r\n-\s\supvar\s#0\swappInt-$chan\sW\r\n+proc\swappInt-parse-header\s{W}\s{\r\n\s\s\sset\shdr\s[split\s[dict\sget\s$W\s.header]\s\\n]\r\n\s\s\sif\s{$hdr==""}\s{return\s1}\r\n\s\s\sset\sreq\s[lindex\s$hdr\s0]\r\n@@\s-555,7\s+552,7\s@@\sproc\swappInt-parse-header\s{chan}\s{\r\n\s\s\s\s\s}\r\n\s\s\s\s\sdict\sset\sW\s$name\s$value\r\n\s\s\s}\r\n-\s\sreturn\s0\r\n+\s\sreturn\s$W\r\n\s}\r\n\s\r\n\s#\sDecode\sthe\sQUERY_STRING\sparameters\sfrom\sa\sGET\srequest\sor\sthe\r\n@@\s-618,6\s+615,10\s@@\sproc\swappInt-decode-query-params\s{}\s{\r\n\s#\r\n\sproc\swappInt-handle-request\s{chan\suseCgi}\s{\r\n\s\s\sglobal\swapp\r\n+\s\sif\s{$chan\sni\s[chan\snames]}\s{\r\n+\s\s\s\sreturn\r\n+\s\s}\r\n+\s\sfileevent\s$chan\sreadable\s{}\r\n\s\s\sdict\sset\swapp\s.reply\s{}\r\n\s\s\sdict\sset\swapp\s.mimetype\s{text/html;\scharset=utf-8}\r\n\s\s\sdict\sset\swapp\s.reply-code\s{200\sOk}\r\n@@\s-818,14\s+819,13\s@@\sproc\swappInt-handle-cgi-request\s{}\s{\r\n\s\r\n\s#\sProcess\snew\stext\sreceived\son\san\sinbound\sSCGI\srequest\r\n\s#\r\n-proc\swappInt-scgi-readable\s{chan}\s{\r\n-\s\sif\s{[catch\s[list\swappInt-scgi-readable-unsafe\s$chan]\smsg]}\s{\r\n+proc\swappInt-scgi-readable\s{W\schan}\s{\r\n+\s\sif\s{[catch\s[list\swappInt-scgi-readable-unsafe\s$W\s$chan]\smsg]}\s{\r\n\s\s\s\s\sputs\sstderr\s"$msg\\n$::errorInfo"\r\n\s\s\s\s\swappInt-close-channel\s$chan\r\n\s\s\s}\r\n\s}\r\n-proc\swappInt-scgi-readable-unsafe\s{chan}\s{\r\n-\s\supvar\s#0\swappInt-$chan\sW\swapp\swapp\r\n+proc\swappInt-scgi-readable-unsafe\s{W\schan}\s{\r\n\s\s\sif\s{![dict\sexists\s$W\s.toread]}\s{\r\n\s\s\s\s\s#\sIf\sthe\s.toread\skey\sis\snot\sset,\sthat\smeans\swe\sare\sstill\sreading\r\n\s\s\s\s\s#\sthe\sheader.\r\n@@\s-855,6\s+855,7\s@@\sproc\swappInt-scgi-readable-unsafe\s{chan}\s{\r\n\s\s\s\s\s\s\sdict\sset\sW\sSERVER_ADDR\s[dict\sget\s$W\s.remove_addr]\r\n\s\s\s\s\s\s\sset\swapp\s$W\r\n\s\s\s\s\s\s\swappInt-handle-request\s$chan\s0\r\n+\s\s\s\s\s\sreturn\r\n\s\s\s\s\s}\r\n\s\s\s}\selse\s{\r\n\s\s\s\s\s#\sIf\s.toread\sis\sset,\sthat\smeans\swe\sare\sreading\sthe\squery\scontent.\r\n@@\s-867,8\s+868,10\s@@\sproc\swappInt-scgi-readable-unsafe\s{chan}\s{\r\n\s\s\s\s\s\s\sdict\sset\sW\sSERVER_ADDR\s[dict\sget\s$W\s.remove_addr]\r\n\s\s\s\s\s\s\sset\swapp\s$W\r\n\s\s\s\s\s\s\swappInt-handle-request\s$chan\s0\r\n+\s\s\s\s\s\sreturn\r\n\s\s\s\s\s}\r\n\s\s\s}\r\n+\s\sfileevent\s$chan\sreadable\s[list\swappInt-scgi-readable\s$W\s$chan]\r\n\s}\r\n\s\r\n\s#\sStart\sup\sthe\swapp\sframework.\s\sParameters\sare\sa\slist\spassed\sas\sthe
J login mjanssen
J mimetype text/plain
J priority Immediate
J resolution Open
K 207094dd9de1343af9d874b8562fc1b4169c3e44
U mjanssen
Z 6ed613c471ddcda0fbf2ceab03057aa0