Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General tidy of Netutils module #1599

Merged
merged 2 commits into from
Feb 6, 2019

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Feb 6, 2019

Use const qualifier where appropriate
Use unsigned instead of int where appropriate
Replace commented-out code with conditional compilation
Refactor debugPrintTcpList

Use `const` qualifier where appropriate
Use `unsigned` instead of `int` where appropriate
Replace commented-out code with conditional compilation
Refactor `debugPrintTcpList`
Remove double carriage returns, add PCB type as parameter to `debugPrintTcp()`
@mikee47
Copy link
Contributor Author

mikee47 commented Feb 6, 2019

debugPrintTcpList() sample output:

24390805 ********** Lwip Active PCB states:
24390953 LWIP_DEBUG: Port 80 | 55613 flg:41 tmr:0025 ESTABLISHED
24391153 LWIP_DEBUG: Port 80 | 55612 flg:40 tmr:0025 ESTABLISHED
24391335 ********** Lwip Listen PCB states:
24391455 LWIP_DEBUG: Port 80 | 0 flg:38 tmr:0000 LISTEN
24391611 ********** Lwip TIME-WAIT PCB states:
24391733 LWIP_DEBUG: Port 80 | 55611 flg:70 tmr:0001 TIME_WAIT
24391905 LWIP_DEBUG: Port 80 | 55610 flg:70 tmr:0001 TIME_WAIT

@slaff slaff added this to the 3.7.2 milestone Feb 6, 2019

// Debug
static void debugPrintTcpList();

private:
#ifdef FIX_NETWORK_ROUTING
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since FIX_NETWORK_ROUTING is not defined by default the current behaviour will be changed, right? Or I am missing something?

Copy link
Contributor Author

@mikee47 mikee47 Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be the same - see previous implemention of FixNetworkRouting() function (should be fixNetworkRouting()?) All commented out and just returned true.

I haven't dug into the purpose of this at all - if it was only required for an old version of LWIP then can probably just delete it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, the current change looks good then.

@slaff slaff removed the 3 - Review label Feb 6, 2019
@slaff slaff merged commit 611a9ff into SmingHub:develop Feb 6, 2019
@mikee47 mikee47 deleted the fix/netutils_improvements branch February 6, 2019 18:08
@slaff
Copy link
Contributor

slaff commented Feb 8, 2019

@mikee47 Do you want to fix those issues: https://app.codacy.com/app/slaff2/SmingOfficial/commit?cid=320437732#newIssuesView ?

Showing 1 file with new issues 
Sming/SmingCore/Network/NetUtils.cpp
Checking if unsigned variable 'startPos' is less than zero.
90
if(startPos < 0) {
Checking if unsigned variable 'cur' is less than zero.
95
if(cur < 0) {

mikee47 added a commit to mikee47/Sming that referenced this pull request Feb 8, 2019
@mikee47
Copy link
Contributor Author

mikee47 commented Feb 8, 2019

@slaff My bad, fixed. How com Codacy didn't pick this up before merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants