{"action":"created","issue":{"url":"https://api.github.com/repos/valum-framework/valum/issues/128","labels_url":"https://api.github.com/repos/valum-framework/valum/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/valum-framework/valum/issues/128/comments","events_url":"https://api.github.com/repos/valum-framework/valum/issues/128/events","html_url":"https://github.com/valum-framework/valum/issues/128","id":104847552,"number":128,"title":"Splicing req.body hangs SCGI.Server","user":{"login":"Bob131","id":4337852,"avatar_url":"https://avatars.githubusercontent.com/u/4337852?v=3","gravatar_id":"","url":"https://api.github.com/users/Bob131","html_url":"https://github.com/Bob131","followers_url":"https://api.github.com/users/Bob131/followers","following_url":"https://api.github.com/users/Bob131/following{/other_user}","gists_url":"https://api.github.com/users/Bob131/gists{/gist_id}","starred_url":"https://api.github.com/users/Bob131/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bob131/subscriptions","organizations_url":"https://api.github.com/users/Bob131/orgs","repos_url":"https://api.github.com/users/Bob131/repos","events_url":"https://api.github.com/users/Bob131/events{/privacy}","received_events_url":"https://api.github.com/users/Bob131/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-04T08:13:02Z","updated_at":"2015-09-04T16:25:03Z","closed_at":null,"body":"```\r\napp.post(null, (req, res) => {\r\n    var buffer = new MemoryOutputStream.resizable();\r\n    buffer.splice(req.body, OutputStreamSpliceFlags.CLOSE_SOURCE);\r\n    var data = Soup.Form.decode((string) buffer.get_data());\r\n}\r\n```\r\n\r\nThe above code when used with `VSGI.SCGI.Server` hang on `buffer.splice` for some time before finally `GLib-CRITICAL **: g_strsplit: assertion 'string != NULL' failed` is emitted, presumably from `Soup.Form.decode()`.\r\n\r\nThis works as expected with VSGI.Soup"},"comment":{"url":"https://api.github.com/repos/valum-framework/valum/issues/comments/137782064","html_url":"https://github.com/valum-framework/valum/issues/128#issuecomment-137782064","issue_url":"https://api.github.com/repos/valum-framework/valum/issues/128","id":137782064,"user":{"login":"arteymix","id":1318477,"avatar_url":"https://avatars.githubusercontent.com/u/1318477?v=3","gravatar_id":"","url":"https://api.github.com/users/arteymix","html_url":"https://github.com/arteymix","followers_url":"https://api.github.com/users/arteymix/followers","following_url":"https://api.github.com/users/arteymix/following{/other_user}","gists_url":"https://api.github.com/users/arteymix/gists{/gist_id}","starred_url":"https://api.github.com/users/arteymix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arteymix/subscriptions","organizations_url":"https://api.github.com/users/arteymix/orgs","repos_url":"https://api.github.com/users/arteymix/repos","events_url":"https://api.github.com/users/arteymix/events{/privacy}","received_events_url":"https://api.github.com/users/arteymix/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T16:25:03Z","updated_at":"2015-09-04T16:25:03Z","body":"Effectively and it should be noted that Valum is not _yet_ a general purpose web framework, so many utilities are missing to perform body interpretation. It will come, but it is also important to focus on solid basis before bringing these features in.\r\n\r\nValum will _eventually_ become that DRY library you've been dreaming of. VSGI have to remain low-level and minimal. In short, VSGI let you build a DRY framework like Valum and Valum let you write DRY code for your application.\r\n\r\nPre-parsing is not a good approach for many reasons:\r\n\r\n - implicitly use memory to store the representation: you'll realize that VSGI has an insignificant memory trace and this is critical in vertical scaling (memory can be a bottleneck)\r\n - all data formats does not sum up in a `HashTable`\r\n - breaks the very idea of filtering: Valum let you build a pipeline of transformation before actually parsing the data (decompression, charset encoding, ...)\r\n - lose generality as the message can contain any content type and we cannot possibly parse all of them\r\n\r\nI would rather have utilities to parse common data format and use a Converter when it can be applied on a stream (like base64 decoding).\r\n\r\nI am using Valum for an academic project and since I am dealing with JSON documents, I really enjoy stream-based processing:\r\n\r\n```vala\r\nvar parser = new Json.Parser ();\r\n\r\nif (parser.load_from_stream (req.body)) {\r\n    var root = parser.get_root ();\r\n}\r\n```\r\n\r\nThe `0.3` will target many aspects of traditional web development:\r\n\r\n - multipart body (e.g. file submission in form)\r\n - content negotiation (delivering resource in different representation like XML or JSON)\r\n - filters for compression, buffering, ...\r\n - flatten, of course\r\n - reverse a route path given a set of parameters\r\n\r\nThis is why I like to have feedback as it let me identify requirements and what to introduce next. And as you know, features introduce bugs and they have to be carefully selected to reach realistic deadlines."}}