mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
upgrade protobuf to 3.1.0 and use with-bytes feature, issues:958
This commit is contained in:
@@ -17,8 +17,8 @@ pub fn clip_2_msg(clip: ClipbaordFile) -> Message {
|
||||
});
|
||||
}
|
||||
Message {
|
||||
union: Some(message::Union::cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::format_list(CliprdrServerFormatList {
|
||||
union: Some(message::Union::Cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::FormatList(CliprdrServerFormatList {
|
||||
conn_id,
|
||||
formats,
|
||||
..Default::default()
|
||||
@@ -29,8 +29,8 @@ pub fn clip_2_msg(clip: ClipbaordFile) -> Message {
|
||||
}
|
||||
}
|
||||
ClipbaordFile::ServerFormatListResponse { conn_id, msg_flags } => Message {
|
||||
union: Some(message::Union::cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::format_list_response(
|
||||
union: Some(message::Union::Cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::FormatListResponse(
|
||||
CliprdrServerFormatListResponse {
|
||||
conn_id,
|
||||
msg_flags,
|
||||
@@ -45,8 +45,8 @@ pub fn clip_2_msg(clip: ClipbaordFile) -> Message {
|
||||
conn_id,
|
||||
requested_format_id,
|
||||
} => Message {
|
||||
union: Some(message::Union::cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::format_data_request(
|
||||
union: Some(message::Union::Cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::FormatDataRequest(
|
||||
CliprdrServerFormatDataRequest {
|
||||
conn_id,
|
||||
requested_format_id,
|
||||
@@ -62,8 +62,8 @@ pub fn clip_2_msg(clip: ClipbaordFile) -> Message {
|
||||
msg_flags,
|
||||
format_data,
|
||||
} => Message {
|
||||
union: Some(message::Union::cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::format_data_response(
|
||||
union: Some(message::Union::Cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::FormatDataResponse(
|
||||
CliprdrServerFormatDataResponse {
|
||||
conn_id,
|
||||
msg_flags,
|
||||
@@ -86,8 +86,8 @@ pub fn clip_2_msg(clip: ClipbaordFile) -> Message {
|
||||
have_clip_data_id,
|
||||
clip_data_id,
|
||||
} => Message {
|
||||
union: Some(message::Union::cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::file_contents_request(
|
||||
union: Some(message::Union::Cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::FileContentsRequest(
|
||||
CliprdrFileContentsRequest {
|
||||
conn_id,
|
||||
stream_id,
|
||||
@@ -111,8 +111,8 @@ pub fn clip_2_msg(clip: ClipbaordFile) -> Message {
|
||||
stream_id,
|
||||
requested_data,
|
||||
} => Message {
|
||||
union: Some(message::Union::cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::file_contents_response(
|
||||
union: Some(message::Union::Cliprdr(Cliprdr {
|
||||
union: Some(cliprdr::Union::FileContentsResponse(
|
||||
CliprdrFileContentsResponse {
|
||||
conn_id,
|
||||
msg_flags,
|
||||
@@ -130,7 +130,7 @@ pub fn clip_2_msg(clip: ClipbaordFile) -> Message {
|
||||
|
||||
pub fn msg_2_clip(msg: Cliprdr) -> Option<ClipbaordFile> {
|
||||
match msg.union {
|
||||
Some(cliprdr::Union::format_list(data)) => {
|
||||
Some(cliprdr::Union::FormatList(data)) => {
|
||||
let mut format_list: Vec<(i32, String)> = Vec::new();
|
||||
for v in data.formats.iter() {
|
||||
format_list.push((v.id, v.format.clone()));
|
||||
@@ -140,26 +140,26 @@ pub fn msg_2_clip(msg: Cliprdr) -> Option<ClipbaordFile> {
|
||||
format_list,
|
||||
})
|
||||
}
|
||||
Some(cliprdr::Union::format_list_response(data)) => {
|
||||
Some(cliprdr::Union::FormatListResponse(data)) => {
|
||||
Some(ClipbaordFile::ServerFormatListResponse {
|
||||
conn_id: data.conn_id,
|
||||
msg_flags: data.msg_flags,
|
||||
})
|
||||
}
|
||||
Some(cliprdr::Union::format_data_request(data)) => {
|
||||
Some(cliprdr::Union::FormatDataRequest(data)) => {
|
||||
Some(ClipbaordFile::ServerFormatDataRequest {
|
||||
conn_id: data.conn_id,
|
||||
requested_format_id: data.requested_format_id,
|
||||
})
|
||||
}
|
||||
Some(cliprdr::Union::format_data_response(data)) => {
|
||||
Some(cliprdr::Union::FormatDataResponse(data)) => {
|
||||
Some(ClipbaordFile::ServerFormatDataResponse {
|
||||
conn_id: data.conn_id,
|
||||
msg_flags: data.msg_flags,
|
||||
format_data: data.format_data,
|
||||
})
|
||||
}
|
||||
Some(cliprdr::Union::file_contents_request(data)) => {
|
||||
Some(cliprdr::Union::FileContentsRequest(data)) => {
|
||||
Some(ClipbaordFile::FileContentsRequest {
|
||||
conn_id: data.conn_id,
|
||||
stream_id: data.stream_id,
|
||||
@@ -172,7 +172,7 @@ pub fn msg_2_clip(msg: Cliprdr) -> Option<ClipbaordFile> {
|
||||
clip_data_id: data.clip_data_id,
|
||||
})
|
||||
}
|
||||
Some(cliprdr::Union::file_contents_response(data)) => {
|
||||
Some(cliprdr::Union::FileContentsResponse(data)) => {
|
||||
Some(ClipbaordFile::FileContentsResponse {
|
||||
conn_id: data.conn_id,
|
||||
msg_flags: data.msg_flags,
|
||||
|
||||
Reference in New Issue
Block a user