Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix #1443 - trim teaEncode trailing zeroes #1534

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

Merged
ccw808 merged 5 commits into multitheftauto:master from Pirulax:hotfix/1443
Jun 28, 2020

Conversation

@Pirulax
Copy link
Contributor

@Pirulax Pirulax commented Jun 22, 2020
edited
Loading

So basically, with the introduction of sbx's new parser, we started returning strings with lua_pushlstring, which takes a length as an argument, thus pushes the whole string along with padding. The old method used lua_pushstring which used strlen, thus god rid of the padding.
This PR fixes #1443 .

Edit: test resource: utf1443.zip

@qaisjp qaisjp requested a review from sbx320 June 22, 2020 15:20
@qaisjp qaisjp changed the title (削除) Fix #1443 - trim teaEncode block padding(0's) at the end (削除ここまで) (追記) Fix #1443 - trim teaEncode block trailing zeroes (追記ここまで) Jun 22, 2020
@qaisjp qaisjp changed the title (削除) Fix #1443 - trim teaEncode block trailing zeroes (削除ここまで) (追記) Fix #1443 - trim teaEncode trailing zeroes (追記ここまで) Jun 22, 2020
@qaisjp qaisjp added this to the 1.5.8 milestone Jun 22, 2020
Copy link
Contributor Author

Pirulax commented Jun 22, 2020
edited
Loading

I can't connect to my 1.5.6 server, for some stupid reason(a resource sets min client version, and I cant figure out which one)

Please, could someone run a few tests, and post the results here on 1.5.6 server and client?

Test values:

  • 123
  • 1234
  • 0円0円Hello
  • 1230円
  • hithere0円0円0円0円
  • 0円hi0円
  • 0円0円0円0円0円hi0円0円
  • 1230円0円0円0円

They key can be anything. Let it be.. "c++20"

Copy link
Member

ccw808 commented Jun 22, 2020
edited
Loading

@Pirulax mtaserver.conf:

 <minclientversion></minclientversion>
 <minclientversion_auto_update>0</minclientversion_auto_update>

Edit: Oh a resource sets it - Nevermind

Copy link
Contributor Author

Pirulax commented Jun 23, 2020

btw, the problem is that, now I've fixed en/decodeString as well, which has been returning wrong values since it was introduced. Should we keep backwards compatibility? Or just hope nobody tries comparing decoded strings?

Copy link
Contributor Author

Pirulax commented Jun 23, 2020

Btw, since the old one used strnlen it strips all padding from the end, so I'll modify this one to be like that.

Copy link
Contributor Author

Pirulax commented Jun 23, 2020
edited
Loading

@Pirulax mtaserver.conf:

 <minclientversion></minclientversion>
 <minclientversion_auto_update>0</minclientversion_auto_update>

Edit: Oh a resource sets it - Nevermind

Actually, I'm not sure if it was a resource. I think this'll help, thanks!

Copy link
Contributor Author

Pirulax commented Jun 23, 2020

New resource to test: utf1443.zip

@StrixG StrixG added the bug Something isn't working label Jun 23, 2020
Copy link
Contributor Author

Pirulax commented Jun 26, 2020
edited
Loading

We need to fix the padding in teaEncode, because with binary files 0's at the file end is totally acceptable.

Copy link
Contributor Author

Pirulax commented Jun 27, 2020

Perhaps, maybe add a noTrim argument?

@qaisjp qaisjp dismissed their stale review June 27, 2020 20:46

Changes addressed

Copy link
Contributor

qaisjp commented Jun 27, 2020

Lets try and fix the regression in this PR and we can discuss other problems with teaEncode in a separate issue.

Copy link
Member

ccw808 commented Jun 27, 2020

Lets try and fix the regression in this PR and we can discuss other problems with teaEncode in a separate issue.

Agreed. Let's get this fixed yesterday

StrixG reacted with laugh emoji

@ccw808 ccw808 merged commit 767a41c into multitheftauto:master Jun 28, 2020
@Pirulax Pirulax deleted the hotfix/1443 branch June 28, 2020 10:33
StrixG added a commit that referenced this pull request Aug 17, 2020
ccw808 pushed a commit that referenced this pull request Aug 17, 2020
@Pirulax Pirulax restored the hotfix/1443 branch October 2, 2020 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ccw808 ccw808 ccw808 left review comments

@sbx320 sbx320 sbx320 requested changes

+1 more reviewer

@qaisjp qaisjp qaisjp left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

1.5.8

Development

Successfully merging this pull request may close these issues.

Tea encoding bug

AltStyle によって変換されたページ (->オリジナル) /