Skip to content

Conversation

@zeshuai007
Copy link
Member

TConfiguration class (c_glib)

  • Did you create an Apache Jira ticket? (not required for trivial changes)
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

@Jens-G
Copy link
Member

Jens-G commented Jul 29, 2020

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.

Copy link
Member

@Jens-G Jens-G left a 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),
Copy link
Member

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),
Copy link
Member

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),
Copy link
Member

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 */
Copy link
Member

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 */
Copy link
Member

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_;
Copy link
Member

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_;
Copy link
Member

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_;
Copy link
Member

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,
Copy link
Member

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",
Copy link
Member

Choose a reason for hiding this comment

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

"Thtift Configuration" => "Thrift Configuration"

@zeshuai007 zeshuai007 force-pushed the THRIFT-5237-C_glib branch 3 times, most recently from 4f4123c to f8b2b03 Compare August 6, 2020 09:20
@zeshuai007
Copy link
Member Author

Done.Please review again.

@Jens-G Jens-G closed this in c80b8bb Aug 7, 2020
@zeshuai007 zeshuai007 deleted the THRIFT-5237-C_glib branch August 11, 2020 08:47
cfriedt pushed a commit to cfriedt/thrift that referenced this pull request Sep 20, 2020
…TConfiguration class

Client: c_glib
Patch: Zezeng Wang

This closes apache#2208
@cyril867
Copy link

cyril867 commented Mar 17, 2021

@zeshuai007 hi, Does this merge fix CVE-2020-13949 of C language ?

ikhoon added a commit to ikhoon/armeria that referenced this pull request Mar 29, 2021
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
@ikhoon ikhoon mentioned this pull request Mar 29, 2021
1 task
trustin pushed a commit to line/armeria that referenced this pull request Apr 5, 2021
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
@dzhang-b
Copy link

Hi, is this fix merged into 0.14? Could the fix backported to older version like 0.11, 0.12? Thanks

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.

4 participants