[Ovmsdev] Console output batched up while command is run #32
mark at webb-johnson.net
Fri Apr 13 09:14:48 HKT 2018
I think the issue last time was that some protocols go back and modify the unsent buffer. They rely on the mg_send() not sending until control passes back to the loop.
Adding an option flag (default: unset) to allow mg_send to try to send data immediately seems a good solution to this. It can be used in ssh (and telnet?) to _try_ to send immediately. Presumably if the send would block, in mongoose, it doesn’t?
So, yes, please add this.
> On 13 Apr 2018, at 5:00 AM, Stephen Casner <casner at acm.org> wrote:
> Would you like me to modify the Mongoose code to add an option flag so
> that mg_send() will send immediately if it would not block (the way it
> behaved with my modifications before you updated to a newer version)?
> -- Steve
> On Tue, 10 Apr 2018, Stephen Casner wrote:
>> This phenomenon is a consequence of the Mongoose behavior of buffering
>> all the data rather than sending immediately. We talked about some
>> approaches for an option to control that behavior, but I did not
>> implement any at the time since we were running with an unmodified
>> Mongoose at that point and we were not hitting memory crashes after
>> the adjustments we had made with tasks and stacks.
>> Subsequently we did decide to maintain some modifications to Mongoose,
>> so perhaps now I should implement an option for immediate sending.
>> -- Steve
>> On Tue, 10 Apr 2018, Mark Webb-Johnson wrote:
>>> Another one for Steve:
>>> https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/32 <https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/32>
>>> When running commands in ssh console (maybe others), the output is batched up and only output when the command has finished running.
>>> An example is:
>>> test sd
>>> But also:
>>> ota flash http
>>> It would be better if it could be output as the command is run.
>>> The issue is that we get no output when the command is run, then 30 seconds later (when command finishes) everything comes in one big batch output. The progress messages issued while the command runs are batched up.
>>> I don’t know how easy this is (I fear it is fundamental), but please have a look.
>>> Thanks, Mark.
More information about the OvmsDev