{"action":"closed","issue":{"url":"https://api.github.com/repos/SmingHub/Sming/issues/520","labels_url":"https://api.github.com/repos/SmingHub/Sming/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/SmingHub/Sming/issues/520/comments","events_url":"https://api.github.com/repos/SmingHub/Sming/issues/520/events","html_url":"https://github.com/SmingHub/Sming/issues/520","id":124551613,"number":520,"title":"Var position during template processing","user":{"login":"jobidon","id":2282045,"avatar_url":"https://avatars.githubusercontent.com/u/2282045?v=3","gravatar_id":"","url":"https://api.github.com/users/jobidon","html_url":"https://github.com/jobidon","followers_url":"https://api.github.com/users/jobidon/followers","following_url":"https://api.github.com/users/jobidon/following{/other_user}","gists_url":"https://api.github.com/users/jobidon/gists{/gist_id}","starred_url":"https://api.github.com/users/jobidon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jobidon/subscriptions","organizations_url":"https://api.github.com/users/jobidon/orgs","repos_url":"https://api.github.com/users/jobidon/repos","events_url":"https://api.github.com/users/jobidon/events{/privacy}","received_events_url":"https://api.github.com/users/jobidon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SmingHub/Sming/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-01T17:29:50Z","updated_at":"2016-01-31T17:25:24Z","closed_at":"2016-01-31T17:25:24Z","body":"There seems to be an issue with template processing when a variable name happens to be on the edge of the TCP buffer (1024). The code spits out a partial template but does not resume processing of the rest of the template.\r\nTo reproduce, create a template with 1020 bytes of data followed by '{myvariable}' and a bunch of data following that.\r\nWhat happens then is that the first 1020 chars are output and the HTTP server stalls and does not close the connection, resulting in a partial template.\r\n\r\nPreliminary testing indicate that this simple fix corrects the issue:\r\nin Sming/Sming/SmingCore/DataSourceStream.cpp, line 225 should be:\r\nstate = eTES_StartVar;\r\n\r\nThis seems to force the code to resume processing where it left off before reaching the end of the buffer.\r\nFurther tests are required to commit this fix."}}