When I have a request_method POST and data is immediately available (or I know it will take less than second or so to get it), I use the standard reply header HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nConnection: close\r\n\r\n\Content-Length .... followed by the data that came from a malloced string I created to hold the response text.
Works like a champ. However, there is point where the amount of data sufficiently large so that i need to break it up, and there are times when it takes a few seconds or longer to get the data. So two questions. 1. What is the recommended max payload size and/or number of seconds between time request comes in and I have data of unknown length to return where I need to consider using chunked output? 2. If request is small and I do not know the content length, but it might take a few seconds or maybe 60 seconds for sake of argument, then does it make sense to even break up the header to respond with just the header and blow off sending the content length. Wait till I have the data, and send the payload at that time? Is there a best practice chunked output example for sending a AJAX (JQuery) POST result when you do not yet know how long it will take to get all the data, nor know how large each chunk is going to be until you pull it in from whatever app on the server generates it? David -- You received this message because you are subscribed to the Google Groups "mongoose-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-users+unsubscr...@googlegroups.com. To post to this group, send email to mongoose-users@googlegroups.com. Visit this group at http://groups.google.com/group/mongoose-users. For more options, visit https://groups.google.com/d/optout.