Просмотр исходного кода

minreq to remove libssl dep so that easy to deploy

opentrade лет назад: 4
Родитель
Сommit
ea98675b21
3 измененных файлов с 54 добавлено и 570 удалено
  1. 38 555
      Cargo.lock
  2. 1 1
      Cargo.toml
  3. 15 14
      src/lic.rs

+ 38 - 555
Cargo.lock

@@ -124,12 +124,6 @@ version = "0.5.6"
124 124
 source = "registry+https://github.com/rust-lang/crates.io-index"
125 125
 checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
126 126
 
127
-[[package]]
128
-name = "bytes"
129
-version = "1.0.1"
130
-source = "registry+https://github.com/rust-lang/crates.io-index"
131
-checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
132
-
133 127
 [[package]]
134 128
 name = "cc"
135 129
 version = "1.0.65"
@@ -208,17 +202,7 @@ version = "0.7.0"
208 202
 source = "registry+https://github.com/rust-lang/crates.io-index"
209 203
 checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
210 204
 dependencies = [
211
- "core-foundation-sys 0.7.0",
212
- "libc",
213
-]
214
-
215
-[[package]]
216
-name = "core-foundation"
217
-version = "0.9.1"
218
-source = "registry+https://github.com/rust-lang/crates.io-index"
219
-checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62"
220
-dependencies = [
221
- "core-foundation-sys 0.8.2",
205
+ "core-foundation-sys",
222 206
  "libc",
223 207
 ]
224 208
 
@@ -228,12 +212,6 @@ version = "0.7.0"
228 212
 source = "registry+https://github.com/rust-lang/crates.io-index"
229 213
 checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
230 214
 
231
-[[package]]
232
-name = "core-foundation-sys"
233
-version = "0.8.2"
234
-source = "registry+https://github.com/rust-lang/crates.io-index"
235
-checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b"
236
-
237 215
 [[package]]
238 216
 name = "crossbeam-utils"
239 217
 version = "0.8.1"
@@ -318,7 +296,7 @@ version = "0.2.2"
318 296
 source = "registry+https://github.com/rust-lang/crates.io-index"
319 297
 checksum = "1b391911b9a786312a10cb9d2b3d0735adfd5a8113eb3648de26a75e91b0826c"
320 298
 dependencies = [
321
- "rand 0.7.3",
299
+ "rand",
322 300
 ]
323 301
 
324 302
 [[package]]
@@ -327,15 +305,6 @@ version = "1.6.1"
327 305
 source = "registry+https://github.com/rust-lang/crates.io-index"
328 306
 checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
329 307
 
330
-[[package]]
331
-name = "encoding_rs"
332
-version = "0.8.28"
333
-source = "registry+https://github.com/rust-lang/crates.io-index"
334
-checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065"
335
-dependencies = [
336
- "cfg-if 1.0.0",
337
-]
338
-
339 308
 [[package]]
340 309
 name = "env_logger"
341 310
 version = "0.7.1"
@@ -384,7 +353,7 @@ checksum = "0c122a393ea57648015bf06fbd3d372378992e86b9ff5a7a497b076a28c79efe"
384 353
 dependencies = [
385 354
  "cfg-if 1.0.0",
386 355
  "libc",
387
- "redox_syscall 0.1.57",
356
+ "redox_syscall",
388 357
  "winapi 0.3.9",
389 358
 ]
390 359
 
@@ -394,31 +363,6 @@ version = "1.0.7"
394 363
 source = "registry+https://github.com/rust-lang/crates.io-index"
395 364
 checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
396 365
 
397
-[[package]]
398
-name = "foreign-types"
399
-version = "0.3.2"
400
-source = "registry+https://github.com/rust-lang/crates.io-index"
401
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
402
-dependencies = [
403
- "foreign-types-shared",
404
-]
405
-
406
-[[package]]
407
-name = "foreign-types-shared"
408
-version = "0.1.1"
409
-source = "registry+https://github.com/rust-lang/crates.io-index"
410
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
411
-
412
-[[package]]
413
-name = "form_urlencoded"
414
-version = "1.0.1"
415
-source = "registry+https://github.com/rust-lang/crates.io-index"
416
-checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
417
-dependencies = [
418
- "matches",
419
- "percent-encoding",
420
-]
421
-
422 366
 [[package]]
423 367
 name = "fuchsia-zircon"
424 368
 version = "0.3.3"
@@ -538,18 +482,7 @@ checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
538 482
 dependencies = [
539 483
  "cfg-if 0.1.10",
540 484
  "libc",
541
- "wasi 0.9.0+wasi-snapshot-preview1",
542
-]
543
-
544
-[[package]]
545
-name = "getrandom"
546
-version = "0.2.2"
547
-source = "registry+https://github.com/rust-lang/crates.io-index"
548
-checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
549
-dependencies = [
550
- "cfg-if 1.0.0",
551
- "libc",
552
- "wasi 0.10.2+wasi-snapshot-preview1",
485
+ "wasi",
553 486
 ]
554 487
 
555 488
 [[package]]
@@ -558,26 +491,6 @@ version = "0.3.0"
558 491
 source = "registry+https://github.com/rust-lang/crates.io-index"
559 492
 checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
560 493
 
561
-[[package]]
562
-name = "h2"
563
-version = "0.2.7"
564
-source = "registry+https://github.com/rust-lang/crates.io-index"
565
-checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535"
566
-dependencies = [
567
- "bytes 0.5.6",
568
- "fnv",
569
- "futures-core",
570
- "futures-sink",
571
- "futures-util",
572
- "http",
573
- "indexmap",
574
- "slab",
575
- "tokio",
576
- "tokio-util",
577
- "tracing",
578
- "tracing-futures",
579
-]
580
-
581 494
 [[package]]
582 495
 name = "hashbrown"
583 496
 version = "0.9.1"
@@ -592,7 +505,7 @@ name = "hbb_common"
592 505
 version = "0.1.0"
593 506
 dependencies = [
594 507
  "anyhow",
595
- "bytes 0.5.6",
508
+ "bytes",
596 509
  "confy",
597 510
  "directories-next",
598 511
  "dirs-next",
@@ -606,7 +519,7 @@ dependencies = [
606 519
  "protobuf",
607 520
  "protobuf-codegen-pure",
608 521
  "quinn",
609
- "rand 0.7.3",
522
+ "rand",
610 523
  "regex",
611 524
  "serde",
612 525
  "serde_derive",
@@ -631,7 +544,7 @@ dependencies = [
631 544
  "lazy_static",
632 545
  "mac_address",
633 546
  "machine-uid",
634
- "reqwest",
547
+ "minreq",
635 548
  "rocksdb",
636 549
  "rust-ini",
637 550
  "serde",
@@ -649,39 +562,6 @@ dependencies = [
649 562
  "libc",
650 563
 ]
651 564
 
652
-[[package]]
653
-name = "http"
654
-version = "0.2.4"
655
-source = "registry+https://github.com/rust-lang/crates.io-index"
656
-checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11"
657
-dependencies = [
658
- "bytes 1.0.1",
659
- "fnv",
660
- "itoa",
661
-]
662
-
663
-[[package]]
664
-name = "http-body"
665
-version = "0.3.1"
666
-source = "registry+https://github.com/rust-lang/crates.io-index"
667
-checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b"
668
-dependencies = [
669
- "bytes 0.5.6",
670
- "http",
671
-]
672
-
673
-[[package]]
674
-name = "httparse"
675
-version = "1.3.6"
676
-source = "registry+https://github.com/rust-lang/crates.io-index"
677
-checksum = "bc35c995b9d93ec174cf9a27d425c7892722101e14993cd227fdb51d70cf9589"
678
-
679
-[[package]]
680
-name = "httpdate"
681
-version = "0.3.2"
682
-source = "registry+https://github.com/rust-lang/crates.io-index"
683
-checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47"
684
-
685 565
 [[package]]
686 566
 name = "humantime"
687 567
 version = "1.3.0"
@@ -697,64 +577,6 @@ version = "2.0.1"
697 577
 source = "registry+https://github.com/rust-lang/crates.io-index"
698 578
 checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a"
699 579
 
700
-[[package]]
701
-name = "hyper"
702
-version = "0.13.10"
703
-source = "registry+https://github.com/rust-lang/crates.io-index"
704
-checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb"
705
-dependencies = [
706
- "bytes 0.5.6",
707
- "futures-channel",
708
- "futures-core",
709
- "futures-util",
710
- "h2",
711
- "http",
712
- "http-body",
713
- "httparse",
714
- "httpdate",
715
- "itoa",
716
- "pin-project",
717
- "socket2",
718
- "tokio",
719
- "tower-service",
720
- "tracing",
721
- "want",
722
-]
723
-
724
-[[package]]
725
-name = "hyper-tls"
726
-version = "0.4.3"
727
-source = "registry+https://github.com/rust-lang/crates.io-index"
728
-checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed"
729
-dependencies = [
730
- "bytes 0.5.6",
731
- "hyper",
732
- "native-tls",
733
- "tokio",
734
- "tokio-tls",
735
-]
736
-
737
-[[package]]
738
-name = "idna"
739
-version = "0.2.2"
740
-source = "registry+https://github.com/rust-lang/crates.io-index"
741
-checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21"
742
-dependencies = [
743
- "matches",
744
- "unicode-bidi",
745
- "unicode-normalization",
746
-]
747
-
748
-[[package]]
749
-name = "indexmap"
750
-version = "1.6.2"
751
-source = "registry+https://github.com/rust-lang/crates.io-index"
752
-checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3"
753
-dependencies = [
754
- "autocfg",
755
- "hashbrown",
756
-]
757
-
758 580
 [[package]]
759 581
 name = "iovec"
760 582
 version = "0.1.4"
@@ -764,12 +586,6 @@ dependencies = [
764 586
  "libc",
765 587
 ]
766 588
 
767
-[[package]]
768
-name = "ipnet"
769
-version = "2.3.0"
770
-source = "registry+https://github.com/rust-lang/crates.io-index"
771
-checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135"
772
-
773 589
 [[package]]
774 590
 name = "itertools"
775 591
 version = "0.9.0"
@@ -889,15 +705,9 @@ version = "0.2.0"
889 705
 source = "registry+https://github.com/rust-lang/crates.io-index"
890 706
 checksum = "1f1595709b0a7386bcd56ba34d250d626e5503917d05d32cdccddcd68603e212"
891 707
 dependencies = [
892
- "winreg 0.6.2",
708
+ "winreg",
893 709
 ]
894 710
 
895
-[[package]]
896
-name = "matches"
897
-version = "0.1.8"
898
-source = "registry+https://github.com/rust-lang/crates.io-index"
899
-checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
900
-
901 711
 [[package]]
902 712
 name = "memchr"
903 713
 version = "2.3.4"
@@ -905,19 +715,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
905 715
 checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
906 716
 
907 717
 [[package]]
908
-name = "mime"
909
-version = "0.3.16"
718
+name = "minreq"
719
+version = "2.3.1"
910 720
 source = "registry+https://github.com/rust-lang/crates.io-index"
911
-checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"
912
-
913
-[[package]]
914
-name = "mime_guess"
915
-version = "2.0.3"
916
-source = "registry+https://github.com/rust-lang/crates.io-index"
917
-checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212"
721
+checksum = "781e56f7d29192378f0a04948b1e6aec67ce561273b2dd26ac510bbe88d7be70"
918 722
 dependencies = [
919
- "mime",
920
- "unicase",
723
+ "punycode",
921 724
 ]
922 725
 
923 726
 [[package]]
@@ -984,24 +787,6 @@ dependencies = [
984 787
  "winapi 0.3.9",
985 788
 ]
986 789
 
987
-[[package]]
988
-name = "native-tls"
989
-version = "0.2.7"
990
-source = "registry+https://github.com/rust-lang/crates.io-index"
991
-checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4"
992
-dependencies = [
993
- "lazy_static",
994
- "libc",
995
- "log",
996
- "openssl",
997
- "openssl-probe",
998
- "openssl-sys",
999
- "schannel",
1000
- "security-framework 2.2.0",
1001
- "security-framework-sys 2.2.0",
1002
- "tempfile",
1003
-]
1004
-
1005 790
 [[package]]
1006 791
 name = "net2"
1007 792
 version = "0.2.36"
@@ -1051,39 +836,12 @@ version = "1.5.2"
1051 836
 source = "registry+https://github.com/rust-lang/crates.io-index"
1052 837
 checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0"
1053 838
 
1054
-[[package]]
1055
-name = "openssl"
1056
-version = "0.10.33"
1057
-source = "registry+https://github.com/rust-lang/crates.io-index"
1058
-checksum = "a61075b62a23fef5a29815de7536d940aa35ce96d18ce0cc5076272db678a577"
1059
-dependencies = [
1060
- "bitflags",
1061
- "cfg-if 1.0.0",
1062
- "foreign-types",
1063
- "libc",
1064
- "once_cell",
1065
- "openssl-sys",
1066
-]
1067
-
1068 839
 [[package]]
1069 840
 name = "openssl-probe"
1070 841
 version = "0.1.2"
1071 842
 source = "registry+https://github.com/rust-lang/crates.io-index"
1072 843
 checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
1073 844
 
1074
-[[package]]
1075
-name = "openssl-sys"
1076
-version = "0.9.61"
1077
-source = "registry+https://github.com/rust-lang/crates.io-index"
1078
-checksum = "313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f"
1079
-dependencies = [
1080
- "autocfg",
1081
- "cc",
1082
- "libc",
1083
- "pkg-config",
1084
- "vcpkg",
1085
-]
1086
-
1087 845
 [[package]]
1088 846
 name = "ordered-multimap"
1089 847
 version = "0.3.1"
@@ -1100,12 +858,6 @@ version = "0.1.2"
1100 858
 source = "registry+https://github.com/rust-lang/crates.io-index"
1101 859
 checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
1102 860
 
1103
-[[package]]
1104
-name = "percent-encoding"
1105
-version = "2.1.0"
1106
-source = "registry+https://github.com/rust-lang/crates.io-index"
1107
-checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
1108
-
1109 861
 [[package]]
1110 862
 name = "pin-project"
1111 863
 version = "1.0.2"
@@ -1223,6 +975,12 @@ dependencies = [
1223 975
  "protobuf-codegen",
1224 976
 ]
1225 977
 
978
+[[package]]
979
+name = "punycode"
980
+version = "0.4.1"
981
+source = "registry+https://github.com/rust-lang/crates.io-index"
982
+checksum = "e9e1dcb320d6839f6edb64f7a4a59d39b30480d4d1765b56873f7c858538a5fe"
983
+
1226 984
 [[package]]
1227 985
 name = "quick-error"
1228 986
 version = "1.2.3"
@@ -1235,7 +993,7 @@ version = "0.6.1"
1235 993
 source = "registry+https://github.com/rust-lang/crates.io-index"
1236 994
 checksum = "88de58d76d8f82fb28e5c89302119c102bb5b9ce57b034186b559b63ba147a0f"
1237 995
 dependencies = [
1238
- "bytes 0.5.6",
996
+ "bytes",
1239 997
  "err-derive",
1240 998
  "futures",
1241 999
  "libc",
@@ -1253,10 +1011,10 @@ version = "0.6.1"
1253 1011
 source = "registry+https://github.com/rust-lang/crates.io-index"
1254 1012
 checksum = "f0ea0a358c179c6b7af34805c675d1664a9c6a234a7acd7efdbb32d2f39d3d2a"
1255 1013
 dependencies = [
1256
- "bytes 0.5.6",
1014
+ "bytes",
1257 1015
  "ct-logs",
1258 1016
  "err-derive",
1259
- "rand 0.7.3",
1017
+ "rand",
1260 1018
  "ring",
1261 1019
  "rustls",
1262 1020
  "rustls-native-certs",
@@ -1280,23 +1038,11 @@ version = "0.7.3"
1280 1038
 source = "registry+https://github.com/rust-lang/crates.io-index"
1281 1039
 checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
1282 1040
 dependencies = [
1283
- "getrandom 0.1.15",
1284
- "libc",
1285
- "rand_chacha 0.2.2",
1286
- "rand_core 0.5.1",
1287
- "rand_hc 0.2.0",
1288
-]
1289
-
1290
-[[package]]
1291
-name = "rand"
1292
-version = "0.8.3"
1293
-source = "registry+https://github.com/rust-lang/crates.io-index"
1294
-checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
1295
-dependencies = [
1041
+ "getrandom",
1296 1042
  "libc",
1297
- "rand_chacha 0.3.0",
1298
- "rand_core 0.6.2",
1299
- "rand_hc 0.3.0",
1043
+ "rand_chacha",
1044
+ "rand_core",
1045
+ "rand_hc",
1300 1046
 ]
1301 1047
 
1302 1048
 [[package]]
@@ -1306,17 +1052,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1306 1052
 checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
1307 1053
 dependencies = [
1308 1054
  "ppv-lite86",
1309
- "rand_core 0.5.1",
1310
-]
1311
-
1312
-[[package]]
1313
-name = "rand_chacha"
1314
-version = "0.3.0"
1315
-source = "registry+https://github.com/rust-lang/crates.io-index"
1316
-checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
1317
-dependencies = [
1318
- "ppv-lite86",
1319
- "rand_core 0.6.2",
1055
+ "rand_core",
1320 1056
 ]
1321 1057
 
1322 1058
 [[package]]
@@ -1325,16 +1061,7 @@ version = "0.5.1"
1325 1061
 source = "registry+https://github.com/rust-lang/crates.io-index"
1326 1062
 checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
1327 1063
 dependencies = [
1328
- "getrandom 0.1.15",
1329
-]
1330
-
1331
-[[package]]
1332
-name = "rand_core"
1333
-version = "0.6.2"
1334
-source = "registry+https://github.com/rust-lang/crates.io-index"
1335
-checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
1336
-dependencies = [
1337
- "getrandom 0.2.2",
1064
+ "getrandom",
1338 1065
 ]
1339 1066
 
1340 1067
 [[package]]
@@ -1343,16 +1070,7 @@ version = "0.2.0"
1343 1070
 source = "registry+https://github.com/rust-lang/crates.io-index"
1344 1071
 checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
1345 1072
 dependencies = [
1346
- "rand_core 0.5.1",
1347
-]
1348
-
1349
-[[package]]
1350
-name = "rand_hc"
1351
-version = "0.3.0"
1352
-source = "registry+https://github.com/rust-lang/crates.io-index"
1353
-checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
1354
-dependencies = [
1355
- "rand_core 0.6.2",
1073
+ "rand_core",
1356 1074
 ]
1357 1075
 
1358 1076
 [[package]]
@@ -1361,23 +1079,14 @@ version = "0.1.57"
1361 1079
 source = "registry+https://github.com/rust-lang/crates.io-index"
1362 1080
 checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
1363 1081
 
1364
-[[package]]
1365
-name = "redox_syscall"
1366
-version = "0.2.5"
1367
-source = "registry+https://github.com/rust-lang/crates.io-index"
1368
-checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9"
1369
-dependencies = [
1370
- "bitflags",
1371
-]
1372
-
1373 1082
 [[package]]
1374 1083
 name = "redox_users"
1375 1084
 version = "0.3.5"
1376 1085
 source = "registry+https://github.com/rust-lang/crates.io-index"
1377 1086
 checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"
1378 1087
 dependencies = [
1379
- "getrandom 0.1.15",
1380
- "redox_syscall 0.1.57",
1088
+ "getrandom",
1089
+ "redox_syscall",
1381 1090
  "rust-argon2",
1382 1091
 ]
1383 1092
 
@@ -1399,51 +1108,6 @@ version = "0.6.21"
1399 1108
 source = "registry+https://github.com/rust-lang/crates.io-index"
1400 1109
 checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
1401 1110
 
1402
-[[package]]
1403
-name = "remove_dir_all"
1404
-version = "0.5.3"
1405
-source = "registry+https://github.com/rust-lang/crates.io-index"
1406
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
1407
-dependencies = [
1408
- "winapi 0.3.9",
1409
-]
1410
-
1411
-[[package]]
1412
-name = "reqwest"
1413
-version = "0.10.10"
1414
-source = "registry+https://github.com/rust-lang/crates.io-index"
1415
-checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c"
1416
-dependencies = [
1417
- "base64 0.13.0",
1418
- "bytes 0.5.6",
1419
- "encoding_rs",
1420
- "futures-core",
1421
- "futures-util",
1422
- "http",
1423
- "http-body",
1424
- "hyper",
1425
- "hyper-tls",
1426
- "ipnet",
1427
- "js-sys",
1428
- "lazy_static",
1429
- "log",
1430
- "mime",
1431
- "mime_guess",
1432
- "native-tls",
1433
- "percent-encoding",
1434
- "pin-project-lite 0.2.0",
1435
- "serde",
1436
- "serde_json",
1437
- "serde_urlencoded",
1438
- "tokio",
1439
- "tokio-tls",
1440
- "url",
1441
- "wasm-bindgen",
1442
- "wasm-bindgen-futures",
1443
- "web-sys",
1444
- "winreg 0.7.0",
1445
-]
1446
-
1447 1111
 [[package]]
1448 1112
 name = "ring"
1449 1113
 version = "0.16.18"
@@ -1519,7 +1183,7 @@ dependencies = [
1519 1183
  "openssl-probe",
1520 1184
  "rustls",
1521 1185
  "schannel",
1522
- "security-framework 0.4.4",
1186
+ "security-framework",
1523 1187
 ]
1524 1188
 
1525 1189
 [[package]]
@@ -1561,23 +1225,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1561 1225
 checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535"
1562 1226
 dependencies = [
1563 1227
  "bitflags",
1564
- "core-foundation 0.7.0",
1565
- "core-foundation-sys 0.7.0",
1228
+ "core-foundation",
1229
+ "core-foundation-sys",
1566 1230
  "libc",
1567
- "security-framework-sys 0.4.3",
1568
-]
1569
-
1570
-[[package]]
1571
-name = "security-framework"
1572
-version = "2.2.0"
1573
-source = "registry+https://github.com/rust-lang/crates.io-index"
1574
-checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84"
1575
-dependencies = [
1576
- "bitflags",
1577
- "core-foundation 0.9.1",
1578
- "core-foundation-sys 0.8.2",
1579
- "libc",
1580
- "security-framework-sys 2.2.0",
1231
+ "security-framework-sys",
1581 1232
 ]
1582 1233
 
1583 1234
 [[package]]
@@ -1586,17 +1237,7 @@ version = "0.4.3"
1586 1237
 source = "registry+https://github.com/rust-lang/crates.io-index"
1587 1238
 checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405"
1588 1239
 dependencies = [
1589
- "core-foundation-sys 0.7.0",
1590
- "libc",
1591
-]
1592
-
1593
-[[package]]
1594
-name = "security-framework-sys"
1595
-version = "2.2.0"
1596
-source = "registry+https://github.com/rust-lang/crates.io-index"
1597
-checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339"
1598
-dependencies = [
1599
- "core-foundation-sys 0.8.2",
1240
+ "core-foundation-sys",
1600 1241
  "libc",
1601 1242
 ]
1602 1243
 
@@ -1628,18 +1269,6 @@ dependencies = [
1628 1269
  "serde",
1629 1270
 ]
1630 1271
 
1631
-[[package]]
1632
-name = "serde_urlencoded"
1633
-version = "0.7.0"
1634
-source = "registry+https://github.com/rust-lang/crates.io-index"
1635
-checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9"
1636
-dependencies = [
1637
- "form_urlencoded",
1638
- "itoa",
1639
- "ryu",
1640
- "serde",
1641
-]
1642
-
1643 1272
 [[package]]
1644 1273
 name = "shlex"
1645 1274
 version = "0.1.1"
@@ -1669,7 +1298,7 @@ checksum = "2c29947abdee2a218277abeca306f25789c938e500ea5a9d4b12a5a504466902"
1669 1298
 dependencies = [
1670 1299
  "cfg-if 1.0.0",
1671 1300
  "libc",
1672
- "redox_syscall 0.1.57",
1301
+ "redox_syscall",
1673 1302
  "winapi 0.3.9",
1674 1303
 ]
1675 1304
 
@@ -1719,20 +1348,6 @@ dependencies = [
1719 1348
  "unicode-xid",
1720 1349
 ]
1721 1350
 
1722
-[[package]]
1723
-name = "tempfile"
1724
-version = "3.2.0"
1725
-source = "registry+https://github.com/rust-lang/crates.io-index"
1726
-checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
1727
-dependencies = [
1728
- "cfg-if 1.0.0",
1729
- "libc",
1730
- "rand 0.8.3",
1731
- "redox_syscall 0.2.5",
1732
- "remove_dir_all",
1733
- "winapi 0.3.9",
1734
-]
1735
-
1736 1351
 [[package]]
1737 1352
 name = "termcolor"
1738 1353
 version = "1.1.2"
@@ -1760,28 +1375,13 @@ dependencies = [
1760 1375
  "lazy_static",
1761 1376
 ]
1762 1377
 
1763
-[[package]]
1764
-name = "tinyvec"
1765
-version = "1.2.0"
1766
-source = "registry+https://github.com/rust-lang/crates.io-index"
1767
-checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342"
1768
-dependencies = [
1769
- "tinyvec_macros",
1770
-]
1771
-
1772
-[[package]]
1773
-name = "tinyvec_macros"
1774
-version = "0.1.0"
1775
-source = "registry+https://github.com/rust-lang/crates.io-index"
1776
-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
1777
-
1778 1378
 [[package]]
1779 1379
 name = "tokio"
1780 1380
 version = "0.2.23"
1781 1381
 source = "registry+https://github.com/rust-lang/crates.io-index"
1782 1382
 checksum = "a6d7ad61edd59bfcc7e80dababf0f4aed2e6d5e0ba1659356ae889752dfc12ff"
1783 1383
 dependencies = [
1784
- "bytes 0.5.6",
1384
+ "bytes",
1785 1385
  "fnv",
1786 1386
  "futures-core",
1787 1387
  "iovec",
@@ -1810,23 +1410,13 @@ dependencies = [
1810 1410
  "syn",
1811 1411
 ]
1812 1412
 
1813
-[[package]]
1814
-name = "tokio-tls"
1815
-version = "0.3.1"
1816
-source = "registry+https://github.com/rust-lang/crates.io-index"
1817
-checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343"
1818
-dependencies = [
1819
- "native-tls",
1820
- "tokio",
1821
-]
1822
-
1823 1413
 [[package]]
1824 1414
 name = "tokio-util"
1825 1415
 version = "0.3.1"
1826 1416
 source = "registry+https://github.com/rust-lang/crates.io-index"
1827 1417
 checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499"
1828 1418
 dependencies = [
1829
- "bytes 0.5.6",
1419
+ "bytes",
1830 1420
  "futures-core",
1831 1421
  "futures-io",
1832 1422
  "futures-sink",
@@ -1844,12 +1434,6 @@ dependencies = [
1844 1434
  "serde",
1845 1435
 ]
1846 1436
 
1847
-[[package]]
1848
-name = "tower-service"
1849
-version = "0.3.1"
1850
-source = "registry+https://github.com/rust-lang/crates.io-index"
1851
-checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
1852
-
1853 1437
 [[package]]
1854 1438
 name = "tracing"
1855 1439
 version = "0.1.22"
@@ -1857,7 +1441,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1857 1441
 checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3"
1858 1442
 dependencies = [
1859 1443
  "cfg-if 1.0.0",
1860
- "log",
1861 1444
  "pin-project-lite 0.2.0",
1862 1445
  "tracing-attributes",
1863 1446
  "tracing-core",
@@ -1883,49 +1466,6 @@ dependencies = [
1883 1466
  "lazy_static",
1884 1467
 ]
1885 1468
 
1886
-[[package]]
1887
-name = "tracing-futures"
1888
-version = "0.2.5"
1889
-source = "registry+https://github.com/rust-lang/crates.io-index"
1890
-checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
1891
-dependencies = [
1892
- "pin-project",
1893
- "tracing",
1894
-]
1895
-
1896
-[[package]]
1897
-name = "try-lock"
1898
-version = "0.2.3"
1899
-source = "registry+https://github.com/rust-lang/crates.io-index"
1900
-checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
1901
-
1902
-[[package]]
1903
-name = "unicase"
1904
-version = "2.6.0"
1905
-source = "registry+https://github.com/rust-lang/crates.io-index"
1906
-checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
1907
-dependencies = [
1908
- "version_check",
1909
-]
1910
-
1911
-[[package]]
1912
-name = "unicode-bidi"
1913
-version = "0.3.5"
1914
-source = "registry+https://github.com/rust-lang/crates.io-index"
1915
-checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0"
1916
-dependencies = [
1917
- "matches",
1918
-]
1919
-
1920
-[[package]]
1921
-name = "unicode-normalization"
1922
-version = "0.1.17"
1923
-source = "registry+https://github.com/rust-lang/crates.io-index"
1924
-checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef"
1925
-dependencies = [
1926
- "tinyvec",
1927
-]
1928
-
1929 1469
 [[package]]
1930 1470
 name = "unicode-width"
1931 1471
 version = "0.1.8"
@@ -1944,24 +1484,6 @@ version = "0.7.1"
1944 1484
 source = "registry+https://github.com/rust-lang/crates.io-index"
1945 1485
 checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
1946 1486
 
1947
-[[package]]
1948
-name = "url"
1949
-version = "2.2.1"
1950
-source = "registry+https://github.com/rust-lang/crates.io-index"
1951
-checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b"
1952
-dependencies = [
1953
- "form_urlencoded",
1954
- "idna",
1955
- "matches",
1956
- "percent-encoding",
1957
-]
1958
-
1959
-[[package]]
1960
-name = "vcpkg"
1961
-version = "0.2.11"
1962
-source = "registry+https://github.com/rust-lang/crates.io-index"
1963
-checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb"
1964
-
1965 1487
 [[package]]
1966 1488
 name = "vec_map"
1967 1489
 version = "0.8.2"
@@ -1974,28 +1496,12 @@ version = "0.9.2"
1974 1496
 source = "registry+https://github.com/rust-lang/crates.io-index"
1975 1497
 checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
1976 1498
 
1977
-[[package]]
1978
-name = "want"
1979
-version = "0.3.0"
1980
-source = "registry+https://github.com/rust-lang/crates.io-index"
1981
-checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
1982
-dependencies = [
1983
- "log",
1984
- "try-lock",
1985
-]
1986
-
1987 1499
 [[package]]
1988 1500
 name = "wasi"
1989 1501
 version = "0.9.0+wasi-snapshot-preview1"
1990 1502
 source = "registry+https://github.com/rust-lang/crates.io-index"
1991 1503
 checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
1992 1504
 
1993
-[[package]]
1994
-name = "wasi"
1995
-version = "0.10.2+wasi-snapshot-preview1"
1996
-source = "registry+https://github.com/rust-lang/crates.io-index"
1997
-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
1998
-
1999 1505
 [[package]]
2000 1506
 name = "wasm-bindgen"
2001 1507
 version = "0.2.68"
@@ -2003,8 +1509,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
2003 1509
 checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42"
2004 1510
 dependencies = [
2005 1511
  "cfg-if 0.1.10",
2006
- "serde",
2007
- "serde_json",
2008 1512
  "wasm-bindgen-macro",
2009 1513
 ]
2010 1514
 
@@ -2023,18 +1527,6 @@ dependencies = [
2023 1527
  "wasm-bindgen-shared",
2024 1528
 ]
2025 1529
 
2026
-[[package]]
2027
-name = "wasm-bindgen-futures"
2028
-version = "0.4.18"
2029
-source = "registry+https://github.com/rust-lang/crates.io-index"
2030
-checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da"
2031
-dependencies = [
2032
- "cfg-if 0.1.10",
2033
- "js-sys",
2034
- "wasm-bindgen",
2035
- "web-sys",
2036
-]
2037
-
2038 1530
 [[package]]
2039 1531
 name = "wasm-bindgen-macro"
2040 1532
 version = "0.2.68"
@@ -2151,15 +1643,6 @@ dependencies = [
2151 1643
  "winapi 0.3.9",
2152 1644
 ]
2153 1645
 
2154
-[[package]]
2155
-name = "winreg"
2156
-version = "0.7.0"
2157
-source = "registry+https://github.com/rust-lang/crates.io-index"
2158
-checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
2159
-dependencies = [
2160
- "winapi 0.3.9",
2161
-]
2162
-
2163 1646
 [[package]]
2164 1647
 name = "ws2_32-sys"
2165 1648
 version = "0.2.1"

+ 1 - 1
Cargo.toml

@@ -19,7 +19,7 @@ serde_json = "1.0"
19 19
 lazy_static = "1.4"
20 20
 clap = "2.33"
21 21
 rust-ini = "0.16"
22
-reqwest = { version = "0.10", features = ["json", "blocking"] }
22
+minreq = { version = "2.3.1", features = ["punycode"] }
23 23
 machine-uid = "0.2"
24 24
 mac_address = "1.1"
25 25
 whoami = "0.9"

+ 15 - 14
src/lic.rs

@@ -60,26 +60,27 @@ fn write_lic(lic: &str) {
60 60
 
61 61
 fn check_email(machine: String, email: String) -> ResultType<bool> {
62 62
     log::info!("Checking email with the server ...");
63
-    use reqwest::blocking::Client;
64
-    let resp = Client::new()
65
-        .post("http://rustdesk.com/api/check-email")
66
-        .json(&Post {
67
-            machine: machine.clone(),
68
-            email,
69
-            ..Default::default()
70
-        })
63
+    let resp = minreq::post("http://rustdesk.com/api/check-email")
64
+        .with_body(
65
+            serde_json::to_string(&Post {
66
+                machine: machine.clone(),
67
+                email,
68
+                ..Default::default()
69
+            })
70
+            .unwrap(),
71
+        )
71 72
         .send()?;
72
-    if resp.status().is_success() {
73
-        let p: Post = resp.json()?;
74
-        if !verify(&p.machine, &machine) {
75
-            bail!("Verification failure");
76
-        }
73
+    if resp.reason_phrase == "OK" {
74
+        let p: Post = serde_json::from_str(&resp.as_str()?)?;
77 75
         if !p.status.is_empty() {
78 76
             bail!("{}", p.status);
79 77
         }
78
+        if !verify(&p.machine, &machine) {
79
+            bail!("Verification failure");
80
+        }
80 81
         write_lic(&p.machine);
81 82
     } else {
82
-        bail!("Server error: {}", resp.status());
83
+        bail!("Server error: {}", resp.reason_phrase);
83 84
     }
84 85
     Ok(true)
85 86
 }