-
Notifications
You must be signed in to change notification settings - Fork 4.1k
THRIFT-5237 Implement MAX_MESSAGE_SIZE and consolidate limits into a TConfiguration class (c_glib) #2208
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
Conversation
|
I'd recommend to ask on the mailing list to find someone to review. I can have a look but my c_glib knowledge is far from being an expert, so a second opinion would be sort of required anyway. |
e6f94fc to
6beeeac
Compare
Jens-G
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far, except a few minorish things I'd like you to fix or modify.
| return -1; | ||
| } | ||
|
|
||
| if(FALSE == ttc->checkReadBytesAvailable(THRIFT_TRANSPORT(tp->transport), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if( FALSE == ...) - we can do better, can we?
| return -1; | ||
| } | ||
|
|
||
| if(FALSE == ttc->checkReadBytesAvailable(THRIFT_TRANSPORT(tp->transport), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
| } | ||
|
|
||
|
|
||
| if(FALSE == ttc->checkReadBytesAvailable(THRIFT_TRANSPORT (tp->transport), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, and there are a few more below
| "Set the size of the remaining message", | ||
| 0, /* min */ | ||
| G_MAXINT32, /* max */ | ||
| 10485760, /* default by construct */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we put that 10485760 into some constant and give it a meaningful name?
| "Set the size of the know message", | ||
| 0, /* min */ | ||
| G_MAXINT32, /* max */ | ||
| 10485760, /* default by construct */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, plus some more below
| transport->configuration = g_value_dup_object (value); | ||
| if(transport->configuration != NULL) | ||
| { | ||
| transport->remainingMessageSize_ = transport->configuration->maxMessageSize_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: indent?
| transport->configuration = g_value_get_object (value); | ||
| if(transport->configuration != NULL) | ||
| { | ||
| transport->remainingMessageSize_ = transport->configuration->maxMessageSize_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: indent?
| { | ||
| if(tt->configuration != NULL) | ||
| { | ||
| tt->knowMessageSize_ = tt->configuration->maxMessageSize_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: indent?
| else | ||
| { | ||
| tt->remainingMessageSize_ = 0; | ||
| g_set_error(error, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent?
|
|
||
| param_spec = g_param_spec_object ("configuration", | ||
| "configuration (construct)", | ||
| "Thtift Configuration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Thtift Configuration" => "Thrift Configuration"
4f4123c to
f8b2b03
Compare
|
Done.Please review again. |
…TConfiguration class (c_glib)
f8b2b03 to
ed09218
Compare
…TConfiguration class Client: c_glib Patch: Zezeng Wang This closes apache#2208
|
@zeshuai007 hi, Does this merge fix CVE-2020-13949 of C language ? |
Motivation: Thrift has been released 0.14.0 with breaking changes. - apache/thrift#2208 - apache/thrift#2138 We need a workaround to share Armeria Thrift implementions from 0.9 to 0.14.0 Modifications: - Add `armeria-thrift0.14` module - Copy sources from `armeria-thrift0.13` and override `TByteBufTransport` for implementing newly added API - Catch checked exceptions which are newly added and throws unsafely for compatibility - The checked exceptions will not be raised actually - Use `armeria-thrift0.14` as the default dependencies for Armeria modules and testing Result: - You can now use Thrift 0.14.x with Armeria Thrift server and client - Fixes line#3370
Motivation: Thrift has been released 0.14.0 with breaking changes. - apache/thrift#2208 - apache/thrift#2138 We need a workaround to share Armeria Thrift implementions from 0.9 to 0.14.0 Modifications: - Add `armeria-thrift0.14` module - Copy sources from `armeria-thrift0.13` and override `TByteBufTransport` for implementing newly added API - Catch checked exceptions which are newly added and throws unsafely for compatibility - The checked exceptions will not be raised actually - Use `armeria-thrift0.14` as the default dependencies for Armeria modules and testing Result: - You can now use [libthrift 0.14.x](https://search.maven.org/artifact/org.apache.thrift/libthrift/0.14.1/jar) with Armeria Thrift server and client - Fixes #3370
|
Hi, is this fix merged into 0.14? Could the fix backported to older version like 0.11, 0.12? Thanks |
TConfiguration class (c_glib)
[skip ci]anywhere in the commit message to free up build resources.