parallaxinc / Simple-Libraries

Contents of the SimpleIDE workspace folder and its Parallax Learn Simple Libraries subfolder.
http://learn.parallax.com/propeller-c-set-simpleide/update-your-learn-folder
21 stars 21 forks source link

recv.c #198

Open VonSzarvas opened 5 years ago

VonSzarvas commented 5 years ago

wifi_recv command can "block forever" if tcp rx buffer empty when bytes requested.

one issue at a glance.... line 70 looks like a problem.

if(bytesReady == 0) return 0;

because in that scenario, line 79 doesn't get called !

wifi_simpletermResume();

so the debug term will appear to crash.

There may be more to this, and the same issue applies to wifi_scan. I don't think wifi_recv should block under any circumstances. However- the "block forever" concern may just be an issue for Badge users, as simpleterm is required for all comms.

AndyLindsay commented 5 years ago

Nice catch. Do you want to try the fix in demo.blockly.parallax.com?

VonSzarvas commented 5 years ago

This is the fix thus far. Perhaps wait on demo until it's tested, as may be some other gremlin to satisfy! Will know in a couple days.

recv.c.txt

AndyLindsay commented 5 years ago

Okay, thanks. I saw in some other correspondence that sscan might be up to some mischief too. Will wait for more news before updating.

On Wed, Jul 3, 2019 at 11:48 AM Michael notifications@github.com wrote:

This is the fix thus far. Perhaps wait on demo until it's tested, as may be some other gremlin to satisfy! Will know in a couple days.

recv.c.txt https://github.com/parallaxinc/Simple-Libraries/files/3356412/recv.c.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/parallaxinc/Simple-Libraries/issues/198?email_source=notifications&email_token=ACYKA5776GMWYGH52D2Z4FLP5TX6XA5CNFSM4H5IQNQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZFLSIQ#issuecomment-508213538, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYKA5446P34OFNJSE7HSDTP5TX6XANCNFSM4H5IQNQA .

AndyLindsay commented 5 years ago

On second thought, I'll update the Dev branch with anything that needs testing. You can get the zip with everything else current here: https://github.com/parallaxinc/Simple-Libraries/archive/Dev.zip Here is info on the latest commit with your version of recv.c compiled in.