Skip to content

Commit beb9d4e

Browse files
committed
moving to request headers
1 parent 6deffc9 commit beb9d4e

2 files changed

Lines changed: 7 additions & 19 deletions

File tree

lib/protobuf/rpc/rpc.pb.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class ErrorReason < ::Protobuf::Enum
3131
#
3232
class Request < ::Protobuf::Message; end
3333
class Response < ::Protobuf::Message; end
34-
class Trace < ::Protobuf::Message; end
35-
class MapEntry < ::Protobuf::Message; end
34+
class Header < ::Protobuf::Message; end
3635

3736

3837
##
@@ -43,9 +42,9 @@ class Request
4342
required :string, :method_name, 2
4443
optional :bytes, :request_proto, 3
4544
optional :string, :caller, 4
45+
repeated ::Protobuf::Socketrpc::Header, :headers, 5
4646
# Extension Fields
4747
extensions 200...536870912
48-
optional ::Protobuf::Socketrpc::Trace, :".protobuf.socketrpc.Request.trace", 200, :extension => true
4948
end
5049

5150
class Response
@@ -56,12 +55,8 @@ class Response
5655
optional :string, :server, 5
5756
end
5857

59-
class Trace
60-
repeated ::Protobuf::Socketrpc::MapEntry, :headers, 1
61-
end
62-
63-
class MapEntry
64-
optional :string, :key, 1
58+
class Header
59+
required :string, :key, 1
6560
optional :string, :value, 2
6661
end
6762

proto/rpc.proto

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ message Request
3232
required string method_name = 2; // Service method to invoke
3333
optional bytes request_proto = 3; // Serialized request bytes
3434
optional string caller = 4; // Calling hostname or address
35-
36-
extend Request {
37-
optional Trace trace = 200;
38-
}
35+
repeated Header headers = 5; // General purpose request headers
3936
}
4037

4138
message Response
@@ -47,12 +44,8 @@ message Response
4744
optional string server = 5; // Server hostname or address
4845
}
4946

50-
message Trace {
51-
repeated MapEntry headers = 1;
52-
}
53-
54-
message MapEntry {
55-
optional string key = 1;
47+
message Header {
48+
required string key = 1;
5649
optional string value = 2;
5750
}
5851

0 commit comments

Comments
 (0)