team-ljyzipelo

공개
823줄26 KB
1use std::{collections::BTreeSet, path::PathBuf};
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq)]
4pub enum Format {
5 Zip,
6 Tar,
7 Gzip,
8 TarGzip,
9 SevenZip,
10}
11#[derive(Clone, Debug, Eq, PartialEq)]
12pub enum SourceObject {
13 Unix { device: u64, inode: u64 },
14 Windows { volume: u64, file_id: [u8; 16] },
15}
16#[derive(Clone, Debug, Eq, PartialEq)]
17pub struct ListId {
18 pub catalog_version: u16,
19 pub format: Format,
20 pub source_object: SourceObject,
21 pub archive_bytes: u64,
22 pub archive_sha256: [u8; 32],
23}
24#[derive(Clone, Debug, Eq, PartialEq)]
25pub enum Selection {
26 All,
27 EntryIds(Vec<u32>),
28}
29#[derive(Clone, Copy, Debug, Eq, PartialEq)]
30pub enum Method {
31 Store,
32 Deflate,
33}
34#[derive(Clone, Debug, Eq, PartialEq)]
35pub enum Start {
36 List {
37 archive: PathBuf,
38 },
39 Extract {
40 archive: PathBuf,
41 destination: PathBuf,
42 selection: Selection,
43 list_id: ListId,
44 gzip_output_name: Option<String>,
45 },
46 CreateZip {
47 sources: Vec<(PathBuf, String)>,
48 output_file: PathBuf,
49 method: Method,
50 aes256: bool,
51 },
52}
53// 암호를 Debug와 로그에서 제외하고 소유 버퍼를 해제 전에 지움.
54pub struct Secret(Vec<u8>);
55impl Secret {
56 pub fn new(text: String) -> Result<Self, &'static str> {
57 let mut bytes = text.into_bytes();
58 if bytes.is_empty() || bytes.len() > 1024 {
59 bytes.fill(0);
60 return Err("암호는 UTF-8 1~1024바이트로 입력하세요");
61 }
62 Ok(Self(bytes))
63 }
64 pub fn as_bytes(&self) -> &[u8] {
65 &self.0
66 }
67}
68impl Drop for Secret {
69 fn drop(&mut self) {
70 self.0.fill(0);
71 }
72}
73pub enum Command {
74 Start(Start),
75 Password { challenge_id: u64, secret: Secret },
76 Cancel,
77}
78pub struct Request {
79 pub job_id: u64,
80 pub sequence: u64,
81 pub command: Command,
82}
83#[derive(Clone, Copy, Debug, Eq, PartialEq)]
84pub enum Kind {
85 File,
86 Directory,
87 Link,
88 Other,
89}
90#[derive(Clone, Debug, Eq, PartialEq)]
91pub struct Entry {
92 pub id: u32,
93 pub name: String,
94 pub kind: Kind,
95 pub bytes: Option<u64>,
96 pub packed: Option<u64>,
97 pub encrypted: bool,
98}
99#[derive(Clone, Copy, Debug, Eq, PartialEq)]
100pub enum CancelStatus {
101 Requested,
102 AlreadyRequested,
103 TooLate,
104 Finished,
105}
106#[derive(Clone, Copy, Debug, Eq, PartialEq)]
107pub enum Stage {
108 Scan,
109 Read,
110 Decode,
111 Write,
112 Verify,
113 Commit,
114}
115#[derive(Clone, Copy, Debug, Eq, PartialEq)]
116pub enum Outcome {
117 Completed,
118 Failed,
119 Cancelled,
120}
121#[derive(Clone, Copy, Debug, Eq, PartialEq)]
122pub enum ErrorCode {
123 Integrity,
124 UnsupportedFormat,
125 UnsupportedFeature,
126 WrongPassword,
127 UnsafePath,
128 Conflict,
129 Limit,
130 Io,
131 DiskFull,
132 Protocol,
133 Internal,
134 SourceChanged,
135 InvalidRequest,
136}
137#[derive(Clone, Copy, Debug, Eq, PartialEq)]
138pub enum Publication {
139 None,
140 Partial,
141 Complete,
142 Uncertain,
143}
144#[derive(Clone, Copy, Debug, Eq, PartialEq)]
145pub enum Durability {
146 NotApplicable,
147 Synced,
148 Unconfirmed,
149 Failed,
150}
151#[derive(Clone, Copy, Debug, Eq, PartialEq)]
152pub enum Cleanup {
153 Complete,
154 Failed,
155 Unconfirmed,
156}
157#[derive(Clone, Copy, Debug, Eq, PartialEq)]
158pub enum Disposition {
159 Created,
160 PartialRetained,
161 Removed,
162 CommitUncertain,
163}
164#[derive(Clone, Debug)]
165pub struct Terminal {
166 pub outcome: Outcome,
167 pub error: Option<ErrorCode>,
168 pub publication: Publication,
169 pub created_count: u64,
170 pub retained_partial_count: u64,
171 pub durability: Durability,
172 pub cleanup: Cleanup,
173}
174#[derive(Clone, Debug)]
175pub enum Event {
176 Accepted {
177 encryption: bool,
178 },
179 Entry(Entry),
180 ListEnd {
181 entry_count: u32,
182 list_id: ListId,
183 },
184 PasswordRequired {
185 challenge_id: u64,
186 attempt: u32,
187 encrypt: bool,
188 },
189 Progress {
190 stage: Stage,
191 processed: u64,
192 total: Option<u64>,
193 completed_entries: u64,
194 },
195 Output {
196 entry_id: Option<u32>,
197 relative_name: String,
198 disposition: Disposition,
199 },
200 CancelAck {
201 request_sequence: u64,
202 status: CancelStatus,
203 },
204 Terminal(Terminal),
205}
206pub enum HostEvent {
207 Fault(String),
208 CleanupComplete,
209 Frame {
210 job_id: u64,
211 sequence: u64,
212 event: Event,
213 },
214 StdoutEof,
215 StderrEof,
216 Exited {
217 success: bool,
218 },
219}
220// 바이트 codec과 프로세스 소유는 작업자 어댑터에서 담당함.
221// 전송 실패 후에도 poll로 양쪽 EOF와 자식 회수 결과를 전달함.
222pub trait Connection {
223 fn send(&mut self, request: Request) -> Result<(), String>;
224 fn poll(&mut self) -> Option<HostEvent>;
225}
226pub trait Factory {
227 fn connect(&mut self, job_id: u64) -> Result<Box<dyn Connection>, String>;
228}
229pub struct Unavailable;
230impl Factory for Unavailable {
231 fn connect(&mut self, _: u64) -> Result<Box<dyn Connection>, String> {
232 Err("작업자 연결이 아직 준비되지 않았습니다".into())
233 }
234}
235struct Running {
236 id: u64,
237 outgoing: u64,
238 incoming: u64,
239 accepted: bool,
240 start_failed: bool,
241 start: Start,
242 connection: Box<dyn Connection>,
243 entries: Vec<Entry>,
244 list_end: Option<(u32, ListId)>,
245 stdout_eof: bool,
246 transport_closed: bool,
247 stderr_eof: bool,
248 exit: Option<bool>,
249 cancel_sequence: Option<u64>,
250}
251#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
252pub enum Close {
253 #[default]
254 Open,
255 Confirm,
256 Waiting,
257 Review,
258 Allowed,
259}
260#[derive(Default)]
261pub struct Model {
262 running: Option<Running>,
263 next_id: u64,
264 pub archive: Option<PathBuf>,
265 pub entries: Vec<Entry>,
266 pub list_id: Option<ListId>,
267 pub selected: BTreeSet<u32>,
268 pub terminal: Option<Terminal>,
269 pub challenge: Option<(u64, u32, bool)>,
270 pub progress: Option<(Stage, u64, Option<u64>, u64)>,
271 pub outputs: Vec<(String, Disposition)>,
272 pub cancel: Option<CancelStatus>,
273 pub error: Option<String>,
274 pub input_error: Option<String>,
275 pub encryption: bool,
276 pub close: Close,
277 pub confirmed: bool,
278}
279impl Model {
280 pub fn busy(&self) -> bool {
281 self.running.is_some()
282 }
283 pub fn job_id(&self) -> Option<u64> {
284 self.running.as_ref().map(|r| r.id)
285 }
286 pub fn can_extract(&self) -> bool {
287 !self.busy()
288 && self.list_id.is_some()
289 && self.archive.is_some()
290 && self.close == Close::Open
291 }
292 pub fn begin(&mut self, start: Start, factory: &mut dyn Factory) -> bool {
293 if self.busy() || self.close != Close::Open {
294 return false;
295 }
296 let validation = match &start {
297 Start::List { archive } => archive.is_absolute(),
298 Start::Extract {
299 archive,
300 destination,
301 selection,
302 gzip_output_name,
303 list_id,
304 } => {
305 archive.is_absolute()
306 && destination.is_absolute()
307 && self.archive.as_ref() == Some(archive)
308 && self.list_id.as_ref() == Some(list_id)
309 && match list_id.format {
310 Format::Gzip => gzip_output_name.as_ref().is_some_and(|s| valid_leaf(s)),
311 _ => gzip_output_name.is_none(),
312 }
313 && match selection {
314 Selection::All => true,
315 Selection::EntryIds(ids) => {
316 !ids.is_empty()
317 && ids.iter().collect::<BTreeSet<_>>().len() == ids.len()
318 && ids.iter().all(|id| {
319 self.entries.iter().any(|e| {
320 e.id == *id
321 && matches!(e.kind, Kind::File | Kind::Directory)
322 })
323 })
324 }
325 }
326 }
327 Start::CreateZip {
328 sources,
329 output_file,
330 ..
331 } => {
332 !sources.is_empty()
333 && output_file.is_absolute()
334 && sources
335 .iter()
336 .all(|(p, n)| p.is_absolute() && valid_relative(n))
337 }
338 };
339 if !validation {
340 self.input_error = Some("입력 경로, 출력명과 선택한 목록을 확인하세요".into());
341 return false;
342 }
343 let Some(id) = self.next_id.checked_add(1) else {
344 self.error = Some("작업 ID 한도에 도달했습니다".into());
345 return false;
346 };
347 let mut connection = match factory.connect(id) {
348 Ok(c) => c,
349 Err(e) => {
350 self.error = Some(e);
351 return false;
352 }
353 };
354 let send_error = connection
355 .send(Request {
356 job_id: id,
357 sequence: 0,
358 command: Command::Start(start.clone()),
359 })
360 .err();
361 let started = send_error.is_none();
362 if let Start::List { archive } = &start
363 && started
364 {
365 self.archive = Some(archive.clone());
366 self.list_id = None;
367 self.entries.clear();
368 self.selected.clear();
369 }
370 self.next_id = id;
371 self.terminal = None;
372 self.challenge = None;
373 self.progress = None;
374 self.outputs.clear();
375 self.cancel = None;
376 self.input_error = None;
377 self.error = send_error;
378 self.confirmed = false;
379 self.running = Some(Running {
380 id,
381 outgoing: 1,
382 incoming: 0,
383 accepted: false,
384 start_failed: !started,
385 start,
386 connection,
387 entries: Vec::new(),
388 list_end: None,
389 stdout_eof: false,
390 transport_closed: false,
391 stderr_eof: false,
392 exit: None,
393 cancel_sequence: None,
394 });
395 started
396 }
397 pub fn extract(
398 &mut self,
399 destination: PathBuf,
400 selected_only: bool,
401 gzip_output_name: Option<String>,
402 factory: &mut dyn Factory,
403 ) -> bool {
404 if !self.can_extract() {
405 return false;
406 }
407 self.begin(
408 Start::Extract {
409 archive: self.archive.clone().unwrap(),
410 destination,
411 selection: if selected_only {
412 Selection::EntryIds(self.selected.iter().copied().collect())
413 } else {
414 Selection::All
415 },
416 list_id: self.list_id.clone().unwrap(),
417 gzip_output_name,
418 },
419 factory,
420 )
421 }
422 pub fn password(&mut self, text: String) -> bool {
423 let Some((challenge_id, _, _)) = self.challenge else {
424 return false;
425 };
426 let secret = match Secret::new(text) {
427 Ok(s) => s,
428 Err(e) => {
429 self.input_error = Some(e.into());
430 return false;
431 }
432 };
433 if self
434 .send(Command::Password {
435 challenge_id,
436 secret,
437 })
438 .is_some()
439 {
440 self.challenge = None;
441 self.input_error = None;
442 true
443 } else {
444 false
445 }
446 }
447 fn send(&mut self, command: Command) -> Option<u64> {
448 let run = self.running.as_mut()?;
449 if run.start_failed || self.terminal.is_some() || run.exit.is_some() {
450 return None;
451 }
452 let seq = run.outgoing;
453 let Some(next) = seq.checked_add(1) else {
454 self.error = Some("요청 순서 한도 초과".into());
455 return None;
456 };
457 match run.connection.send(Request {
458 job_id: run.id,
459 sequence: seq,
460 command,
461 }) {
462 Ok(()) => {
463 run.outgoing = next;
464 Some(seq)
465 }
466 Err(e) => {
467 self.error = Some(e);
468 None
469 }
470 }
471 }
472 pub fn cancel(&mut self) {
473 if self
474 .running
475 .as_ref()
476 .is_some_and(|r| r.cancel_sequence.is_none())
477 {
478 if let Some(seq) = self.send(Command::Cancel) {
479 self.running.as_mut().unwrap().cancel_sequence = Some(seq);
480 self.challenge = None;
481 self.input_error = None;
482 }
483 }
484 }
485 pub fn request_close(&mut self) {
486 if self.close == Close::Open {
487 self.close = if self.busy() {
488 Close::Confirm
489 } else {
490 Close::Review
491 };
492 }
493 }
494 pub fn confirm_close(&mut self) {
495 if self.close == Close::Confirm {
496 self.cancel();
497 self.close = if self.busy() {
498 Close::Waiting
499 } else {
500 Close::Review
501 };
502 }
503 }
504 pub fn keep_open(&mut self) {
505 if self.close != Close::Allowed {
506 self.close = Close::Open;
507 }
508 }
509 pub fn acknowledge_close(&mut self) {
510 if !self.busy() && self.close == Close::Review {
511 self.close = Close::Allowed;
512 }
513 }
514 pub fn poll(&mut self) {
515 for _ in 0..128 {
516 let Some(event) = self.running.as_mut().and_then(|r| r.connection.poll()) else {
517 break;
518 };
519 self.receive(event);
520 }
521 let complete = self.running.as_ref().is_some_and(|r| {
522 r.exit.is_some()
523 && ((r.stdout_eof && r.stderr_eof) || (r.transport_closed && self.error.is_some()))
524 });
525 if complete {
526 let run = self.running.take().unwrap();
527 self.confirmed =
528 self.terminal.is_some() && run.exit == Some(true) && self.error.is_none();
529 if !self.confirmed {
530 self.error.get_or_insert(
531 "작업자 종료 결과를 확인할 수 없습니다. 출력 상태를 확인하세요".into(),
532 );
533 }
534 if self.confirmed
535 && self
536 .terminal
537 .as_ref()
538 .is_some_and(|t| t.outcome == Outcome::Completed)
539 {
540 if matches!(run.start, Start::List { .. }) {
541 if let Some((count, id)) = run
542 .list_end
543 .filter(|(n, _)| *n as usize == run.entries.len())
544 {
545 let _ = count;
546 self.entries = run.entries;
547 self.list_id = Some(id);
548 } else {
549 self.error = Some("목록 완료 정보가 일치하지 않습니다. 다시 여세요".into());
550 self.confirmed = false;
551 }
552 }
553 }
554 if self
555 .terminal
556 .as_ref()
557 .is_some_and(|t| t.error == Some(ErrorCode::SourceChanged))
558 {
559 self.list_id = None;
560 self.selected.clear();
561 }
562 self.challenge = None;
563 self.input_error = None;
564 if matches!(self.close, Close::Waiting | Close::Confirm) {
565 self.close = Close::Review;
566 }
567 }
568 }
569 fn receive(&mut self, host: HostEvent) {
570 let run = self.running.as_mut().unwrap();
571 match host {
572 HostEvent::Fault(message) => self.error = Some(message),
573 HostEvent::CleanupComplete => run.transport_closed = true,
574 HostEvent::StdoutEof => run.stdout_eof = true,
575 HostEvent::StderrEof => run.stderr_eof = true,
576 HostEvent::Exited { success } => run.exit = Some(success),
577 HostEvent::Frame {
578 job_id,
579 sequence,
580 event,
581 } => {
582 if job_id != run.id
583 || sequence != run.incoming
584 || self.terminal.is_some()
585 || run.stdout_eof
586 || sequence >= 1_000_000
587 {
588 self.error = Some("작업자 응답 순서나 작업 ID가 일치하지 않습니다".into());
589 return;
590 }
591 run.incoming += 1;
592 if !run.accepted && !matches!(event, Event::Accepted { .. }) {
593 self.error = Some("작업 승인 응답이 없습니다".into());
594 return;
595 }
596 match event {
597 Event::Accepted { encryption } => {
598 if run.accepted {
599 self.error = Some("작업 승인 중복".into());
600 }
601 run.accepted = true;
602 self.encryption = encryption;
603 }
604 Event::Entry(entry) => {
605 if !matches!(run.start, Start::List { .. })
606 || run.list_end.is_some()
607 || entry.id as usize != run.entries.len()
608 || entry.name.len() > 4096
609 || run.entries.len() >= 100_000
610 {
611 self.error = Some("목록 응답이 유효하지 않습니다".into());
612 } else {
613 run.entries.push(entry);
614 }
615 }
616 Event::ListEnd {
617 entry_count,
618 list_id,
619 } => {
620 if !matches!(run.start, Start::List { .. })
621 || run.list_end.is_some()
622 || list_id.catalog_version != 1
623 {
624 self.error = Some("목록 완료 응답이 유효하지 않습니다".into());
625 } else {
626 run.list_end = Some((entry_count, list_id));
627 }
628 }
629 Event::PasswordRequired {
630 challenge_id,
631 attempt,
632 encrypt,
633 } => {
634 if self.challenge.is_some() || challenge_id == 0 {
635 self.error = Some("암호 요청이 유효하지 않습니다".into());
636 } else {
637 self.challenge = Some((challenge_id, attempt, encrypt));
638 }
639 }
640 Event::Progress {
641 stage,
642 processed,
643 total,
644 completed_entries,
645 } => self.progress = Some((stage, processed, total, completed_entries)),
646 Event::Output {
647 relative_name,
648 disposition,
649 ..
650 } => {
651 if self.outputs.len() < 100_000 && relative_name.len() <= 4096 {
652 self.outputs.push((relative_name, disposition));
653 } else {
654 self.error = Some("출력 보고 한도 초과".into());
655 }
656 }
657 Event::CancelAck {
658 request_sequence,
659 status,
660 } => {
661 if run.cancel_sequence == Some(request_sequence) && self.cancel.is_none() {
662 self.cancel = Some(status);
663 } else {
664 self.error = Some("취소 응답이 요청과 일치하지 않습니다".into());
665 }
666 }
667 Event::Terminal(t) => {
668 self.challenge = None;
669 self.terminal = Some(t);
670 }
671 }
672 }
673 }
674 }
675 pub fn status(&self) -> String {
676 if let Some(error) = self.error.as_ref().or(self.input_error.as_ref()) {
677 return error.clone();
678 }
679 if self.busy() {
680 if self.terminal.is_some() {
681 return "작업 결과 수신 / 프로세스 종료 확인 중".into();
682 }
683 if self.challenge.is_some() {
684 return "암호를 입력하세요".into();
685 }
686 if let Some(c) = self.cancel {
687 return match c {
688 CancelStatus::Requested | CancelStatus::AlreadyRequested => {
689 "취소 요청 접수 / 최종 결과 대기"
690 }
691 CancelStatus::TooLate => "취소할 수 없는 단계 / 최종 결과 대기",
692 CancelStatus::Finished => "처리 종료 응답 / 프로세스 종료 확인 중",
693 }
694 .into();
695 }
696 if self
697 .running
698 .as_ref()
699 .is_some_and(|r| r.cancel_sequence.is_some())
700 {
701 return "취소 요청 전송 / 최종 결과 대기".into();
702 }
703 return "작업 중".into();
704 }
705 match self
706 .terminal
707 .as_ref()
708 .filter(|_| self.confirmed)
709 .map(|t| t.outcome)
710 {
711 Some(Outcome::Completed) => "작업 완료",
712 Some(Outcome::Cancelled) => "작업 취소됨",
713 Some(Outcome::Failed) => "작업 실패",
714 None => "압축파일을 열거나 ZIP 파일을 만드세요",
715 }
716 .into()
717 }
718}
719pub fn valid_leaf(name: &str) -> bool {
720 valid_relative(name) && !name.contains('/') && !name.contains('\\')
721}
722pub fn valid_relative(name: &str) -> bool {
723 !name.is_empty()
724 && !name.contains('\0')
725 && !name.contains(':')
726 && !name.starts_with('/')
727 && !name.starts_with('\\')
728 && name
729 .split(['/', '\\'])
730 .all(|p| !p.is_empty() && p != "." && p != "..")
731}
732
733// 파일 연결로 전달된 원형 경로를 손실 변환 없이 보존함.
734pub fn launch_args(
735 args: Vec<std::ffi::OsString>,
736 cwd: PathBuf,
737) -> Result<(bool, Option<PathBuf>), &'static str> {
738 let fixture = args.iter().any(|arg| arg == "--ui-fixture");
739 let paths = args
740 .into_iter()
741 .filter(|arg| arg != "--ui-fixture")
742 .collect::<Vec<_>>();
743 if paths.len() > 1 {
744 return Err("압축파일 하나를 지정하세요");
745 }
746 let path = paths
747 .into_iter()
748 .next()
749 .map(PathBuf::from)
750 .map(|p| if p.is_absolute() { p } else { cwd.join(p) });
751 Ok((fixture, path))
752}
753
754pub fn stage_label(stage: Stage) -> &'static str {
755 match stage {
756 Stage::Scan => "목록 읽는 중",
757 Stage::Read => "파일 읽는 중",
758 Stage::Decode => "압축 푸는 중",
759 Stage::Write => "파일 쓰는 중",
760 Stage::Verify => "검증 중",
761 Stage::Commit => "저장 마무리 중",
762 }
763}
764pub fn disposition_label(disposition: Disposition) -> &'static str {
765 match disposition {
766 Disposition::Created => "생성됨",
767 Disposition::PartialRetained => "일부 파일 남음",
768 Disposition::Removed => "작업 임시 파일 정리됨",
769 Disposition::CommitUncertain => "저장 여부 불확실",
770 }
771}
772pub fn terminal_lines(t: &Terminal) -> Vec<String> {
773 let publication = match t.publication {
774 Publication::None => "게시된 파일 없음",
775 Publication::Partial => "일부 파일 게시됨",
776 Publication::Complete => "파일 게시 완료",
777 Publication::Uncertain => "파일 게시 여부 불확실 / 출력 폴더를 확인하세요",
778 };
779 let durability = match t.durability {
780 Durability::NotApplicable => "동기화 해당 없음",
781 Durability::Synced => "디스크 동기화 완료",
782 Durability::Unconfirmed => "디스크 동기화 미확인",
783 Durability::Failed => "디스크 동기화 실패",
784 };
785 let cleanup = match t.cleanup {
786 Cleanup::Complete => "작업 임시 파일 정리 완료",
787 Cleanup::Failed => "작업 임시 파일 정리 실패",
788 Cleanup::Unconfirmed => "작업 임시 파일 정리 미확인",
789 };
790 let mut lines = vec![
791 publication.into(),
792 format!(
793 "생성 {}개 / 남은 임시 파일 {}개",
794 t.created_count, t.retained_partial_count
795 ),
796 format!("{durability} / {cleanup}"),
797 ];
798 if let Some(error) = t.error {
799 lines.push(
800 match error {
801 ErrorCode::Integrity => "압축파일이 손상됐습니다",
802 ErrorCode::UnsupportedFormat => "지원하지 않는 압축 형식입니다",
803 ErrorCode::UnsupportedFeature => "아직 지원하지 않는 기능입니다",
804 ErrorCode::WrongPassword => "암호가 올바르지 않습니다",
805 ErrorCode::UnsafePath => "안전하지 않은 경로가 있어 중단했습니다",
806 ErrorCode::Conflict => "같은 이름의 파일이 있습니다. 다른 출력 폴더를 선택하세요",
807 ErrorCode::Limit => "처리 한도를 초과했습니다",
808 ErrorCode::Io => {
809 "파일을 읽거나 쓰지 못했습니다. 파일과 폴더의 접근 권한을 확인하세요"
810 }
811 ErrorCode::DiskFull => {
812 "디스크 여유 공간이 부족합니다. 공간을 확보한 뒤 다시 시도하세요"
813 }
814 ErrorCode::Protocol => "작업자 응답이 올바르지 않습니다",
815 ErrorCode::Internal => "작업자 처리 오류입니다",
816 ErrorCode::SourceChanged => "원본 파일이 바뀌었습니다. 압축파일을 다시 여세요",
817 ErrorCode::InvalidRequest => "입력과 선택한 항목을 확인하세요",
818 }
819 .into(),
820 );
821 }
822 lines
823}