mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-2030 Thrift allows for inconsistent use of "oneway"
Patch: Jens Geyer
This commit is contained in:
parent
b310ae7816
commit
70a5762736
@ -42,6 +42,9 @@ class t_function : public t_doc {
|
||||
arglist_(arglist),
|
||||
oneway_(oneway) {
|
||||
xceptions_ = new t_struct(NULL);
|
||||
if (oneway_ && (! returntype_->is_void())) {
|
||||
pwarning(1, "Oneway methods should return void.\n");
|
||||
}
|
||||
}
|
||||
|
||||
t_function(t_type* returntype,
|
||||
@ -58,6 +61,9 @@ class t_function : public t_doc {
|
||||
if (oneway_ && !xceptions_->get_members().empty()) {
|
||||
throw std::string("Oneway methods can't throw exceptions.");
|
||||
}
|
||||
if (oneway_ && (! returntype_->is_void())) {
|
||||
pwarning(1, "Oneway methods should return void.\n");
|
||||
}
|
||||
}
|
||||
|
||||
~t_function() {}
|
||||
|
Loading…
Reference in New Issue
Block a user