Commit c31c26495e081c2d25f48e6c2b72253563d48363

Authored by perry.werneck@gmail.com
1 parent 105de2b0

Ajuste no tratamento de hostname para o novo formato de conexão

po/pt_BR.po
... ... @@ -5,7 +5,7 @@ msgid ""
5 5 msgstr ""
6 6 "Project-Id-Version: pw3270 5.0\n"
7 7 "Report-Msgid-Bugs-To: \n"
8   -"POT-Creation-Date: 2013-12-04 08:42-0200\n"
  8 +"POT-Creation-Date: 2013-12-06 08:13-0200\n"
9 9 "PO-Revision-Date: 2013-12-03 13:26-0200\n"
10 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 11 "Language-Team: Portugues <>\n"
... ... @@ -19,6 +19,12 @@ msgstr &quot;&quot;
19 19 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20 20 "X-Generator: Gtranslator 2.91.6\n"
21 21  
  22 +#: ssl.c:257 ssl.c:310 connect.c:91 connect.c:104 connect.c:106 connect.c:554
  23 +#: connect.c:571
  24 +#, c-format
  25 +msgid "%s"
  26 +msgstr "%s"
  27 +
22 28 #: window.c:283
23 29 #, c-format
24 30 msgid "%s - Disconnected"
... ... @@ -49,32 +55,32 @@ msgstr &quot;Ação %s precisa do atributo src&quot;
49 55 msgid "%s requires GTK version %d.%d.%d"
50 56 msgstr "%s requer GTK versão %d.%d.%d"
51 57  
52   -#: kybd.c:2694
  58 +#: kybd.c:2681
53 59 #, c-format
54 60 msgid "%s: Bell not supported"
55 61 msgstr "%s: Alerta sonoro não suportado"
56 62  
57   -#: kybd.c:2853
  63 +#: kybd.c:2840
58 64 #, c-format
59 65 msgid "%s: Missing hex digits after \\x"
60 66 msgstr "%s: Faltando dígitos hexadecimais após \\x"
61 67  
62   -#: kybd.c:2793
  68 +#: kybd.c:2780
63 69 #, c-format
64 70 msgid "%s: Unknown character after \\p"
65 71 msgstr "%s: Caractere desconhecido depois de \\p"
66 72  
67   -#: kybd.c:2829
  73 +#: kybd.c:2816
68 74 #, c-format
69 75 msgid "%s: Unknown character after \\pa"
70 76 msgstr "%s: Caractere desconhecido depois de \\pa"
71 77  
72   -#: kybd.c:2807
  78 +#: kybd.c:2794
73 79 #, c-format
74 80 msgid "%s: Unknown character after \\pf"
75 81 msgstr "%s: Caractere desconhecido depois de \\pf"
76 82  
77   -#: kybd.c:2745
  83 +#: kybd.c:2732
78 84 #, c-format
79 85 msgid "%s: Vertical tab not supported"
80 86 msgstr "%s: Tabulação vertical não é suportada"
... ... @@ -84,7 +90,7 @@ msgstr &quot;%s: Tabulação vertical não é suportada&quot;
84 90 msgid "%s: unknown family %d"
85 91 msgstr "%s: Familia %d é inválida"
86 92  
87   -#: telnet.c:1173
  93 +#: telnet.c:1039
88 94 #, c-format
89 95 msgid "%s:%d"
90 96 msgstr "%s:%d"
... ... @@ -194,7 +200,11 @@ msgstr &quot;&quot;
194 200 "A CA certificate is invalid. Either it is not a CA or its extensions are not "
195 201 "consistent with the supplied purpose."
196 202  
197   -#: ft.c:525
  203 +#: ft.c:100
  204 +msgid "Abort sent; awaiting response"
  205 +msgstr "Abort sent; awaiting response"
  206 +
  207 +#: ft.c:553
198 208 msgid "Aborting..."
199 209 msgstr "Abortando..."
200 210  
... ... @@ -202,6 +212,10 @@ msgstr &quot;Abortando...&quot;
202 212 msgid "About security"
203 213 msgstr "Sobre a segurança"
204 214  
  215 +#: ft.c:98
  216 +msgid "Ack received, data flowing"
  217 +msgstr "Ack received, data flowing"
  218 +
205 219 #: paste.c:300
206 220 msgid "Action failed"
207 221 msgstr "Ação falhou"
... ... @@ -252,11 +266,15 @@ msgstr &quot;Reconectar automaticamente&quot;
252 266 msgid "Avblock"
253 267 msgstr "Avblock"
254 268  
  269 +#: ft.c:99
  270 +msgid "Awaiting chance to send an abort"
  271 +msgstr "Awaiting chance to send an abort"
  272 +
255 273 #: colors.c:435
256 274 msgid "Background"
257 275 msgstr "Fundo"
258 276  
259   -#: telnet.c:328
  277 +#: telnet.c:303 connect.c:169
260 278 msgid "Bad winsock version"
261 279 msgstr "Versão winsock inválida"
262 280  
... ... @@ -292,7 +310,7 @@ msgstr &quot;Portal do Software Público Brasileiro&quot;
292 310 msgid "Break"
293 311 msgstr "Break"
294 312  
295   -#: telnet.c:2114
  313 +#: telnet.c:2003
296 314 msgid "Broken pipe"
297 315 msgstr "Conexão interrompida"
298 316  
... ... @@ -326,7 +344,7 @@ msgstr &quot;C_odificação de caracteres:&quot;
326 344 msgid "C_olor scheme:"
327 345 msgstr "Tema de c_ores:"
328 346  
329   -#: toggles.c:177 telnet.c:670
  347 +#: toggles.c:177 telnet.c:645 connect.c:386 connect.c:438
330 348 #, c-format
331 349 msgid "Can't %s network keep-alive"
332 350 msgstr "Can't %s network keep-alive"
... ... @@ -336,11 +354,16 @@ msgstr &quot;Can&#39;t %s network keep-alive&quot;
336 354 msgid "Can't accept unnamed %s"
337 355 msgstr "Não posso aceitar elemento %s sem nome"
338 356  
339   -#: telnet.c:684
  357 +#: telnet.c:659
340 358 #, c-format
341 359 msgid "Can't connect to %s:%d"
342 360 msgstr "Não foi possível conectar a %s:%d"
343 361  
  362 +#: connect.c:242 connect.c:359 connect.c:410
  363 +#, fuzzy, c-format
  364 +msgid "Can't connect to %s:%s"
  365 +msgstr "Não foi possível conectar a %s:%d"
  366 +
344 367 #: host.c:154
345 368 msgid "Can't connect to host"
346 369 msgstr "Não foi possível conectar ao servidor"
... ... @@ -354,7 +377,12 @@ msgstr &quot;Não foi possível converter a linha %d de %s para %s&quot;
354 377 msgid "Can't cut rectangular regions"
355 378 msgstr "Recortar não permitido em seleção retangular"
356 379  
357   -#: ft.c:308
  380 +#: connect.c:226
  381 +#, c-format
  382 +msgid "Can't determine value for environment variable \"%s\" "
  383 +msgstr "Can't determine value for environment variable \"%s\" "
  384 +
  385 +#: ft.c:331
358 386 msgid "Can't get file size"
359 387 msgstr "Não foi possível obter o tamanho do arquivo"
360 388  
... ... @@ -371,7 +399,7 @@ msgstr &quot;Não foi possível carregar arquivo&quot;
371 399 msgid "Can't open file"
372 400 msgstr "Não foi possível abrir arquivo"
373 401  
374   -#: ft.c:216
  402 +#: ft.c:239
375 403 msgid "Can't open local file."
376 404 msgstr "Não foi possível abrir arquivo local."
377 405  
... ... @@ -433,15 +461,25 @@ msgstr &quot;Não foi possível salvar trace no arquivo %s&quot;
433 461 msgid "Can't set host charset"
434 462 msgstr "Não foi possível definir o charset do host"
435 463  
436   -#: v3270/iocallback.c:347
  464 +#: v3270/iocallback.c:359
437 465 msgid "Can't set lib3270 I/O handlers"
438 466 msgstr "Não foi possível registrar manipuladores de I/O 3270"
439 467  
  468 +#: connect.c:570
  469 +#, fuzzy
  470 +msgid "Can't set socket to blocking mode."
  471 +msgstr "Não foi possível definir o descritor de socket SSL"
  472 +
  473 +#: connect.c:570
  474 +#, fuzzy
  475 +msgid "Can't set socket to non blocking mode"
  476 +msgstr "Erro em fcntl(%s) ao ativar o modo não blocante"
  477 +
440 478 #: filetransfer.c:294
441 479 msgid "Can't start download."
442 480 msgstr "Não foi possível iniciar o download."
443 481  
444   -#: ft.c:171 ft.c:183 ft.c:197
  482 +#: ft.c:194 ft.c:206 ft.c:220
445 483 msgid "Can't start file transfer."
446 484 msgstr "Não foi possível iniciar transferência de arquivo."
447 485  
... ... @@ -449,19 +487,45 @@ msgstr &quot;Não foi possível iniciar transferência de arquivo.&quot;
449 487 msgid "Can't start upload."
450 488 msgstr "Não foi possível iniciar upload."
451 489  
452   -#: telnet.c:329
  490 +#: telnet.c:304 connect.c:170
453 491 #, c-format
454 492 msgid "Can't use winsock version %d.%d"
455 493 msgstr "Não é possível usar a Winsock versão %d.%d"
456 494  
457   -#: ft.c:124
  495 +#: ft.c:147
458 496 msgid "Cancelled by user"
459 497 msgstr "Cancelado pelo usuário"
460 498  
461   -#: telnet.c:721
  499 +#: connect.c:324
  500 +#, fuzzy
  501 +msgid "Cannot create socket event"
  502 +msgstr "Não foi possível criar um manipulador de socket"
  503 +
  504 +#: telnet.c:696
462 505 msgid "Cannot create socket handle"
463 506 msgstr "Não foi possível criar um manipulador de socket"
464 507  
  508 +#: ssl.c:309
  509 +msgid "Cant create a new SSL structure for current connection."
  510 +msgstr "Cant create a new SSL structure for current connection."
  511 +
  512 +#: ssl.c:250
  513 +#, c-format
  514 +msgid ""
  515 +"Cant set default locations for trusted CA certificates to\n"
  516 +"%s"
  517 +msgstr ""
  518 +"Cant set default locations for trusted CA certificates to\n"
  519 +"%s"
  520 +
  521 +#: ssl.c:83
  522 +msgid ""
  523 +"Cant set the file descriptor for the input/output facility for the TLS/SSL "
  524 +"(encrypted) side of ssl."
  525 +msgstr ""
  526 +"Cant set the file descriptor for the input/output facility for the TLS/SSL "
  527 +"(encrypted) side of ssl."
  528 +
465 529 #: v3270/security.c:110
466 530 msgid "Certificate has expired"
467 531 msgstr "O certificado expirou"
... ... @@ -518,7 +582,14 @@ msgstr &quot;Command:&quot;
518 582 msgid "Connect on startup"
519 583 msgstr "Conectar ao iniciar"
520 584  
521   -#: telnet.c:2118
  585 +#: connect.c:224 connect.c:263 connect.c:272 connect.c:348 connect.c:363
  586 +#: connect.c:375 connect.c:390 connect.c:414 connect.c:427 connect.c:442
  587 +#: connect.c:540
  588 +#, fuzzy
  589 +msgid "Connection error"
  590 +msgstr "Erro na conexão SSL"
  591 +
  592 +#: telnet.c:2007
522 593 msgid "Connection reset by peer"
523 594 msgstr "Conexão foi cancelada pelo servidor"
524 595  
... ... @@ -608,11 +679,11 @@ msgstr &quot;Padrão&quot;
608 679 msgid "Delete field"
609 680 msgstr "Apagar campo"
610 681  
611   -#: telnet.c:1789
  682 +#: telnet.c:1678
612 683 msgid "Device type rejected"
613 684 msgstr "Tipo de dispositivo rejeitado"
614 685  
615   -#: ft.c:173
  686 +#: ft.c:196
616 687 msgid "Disconnected from host."
617 688 msgstr "Desconectado do servidor."
618 689  
... ... @@ -620,7 +691,7 @@ msgstr &quot;Desconectado do servidor.&quot;
620 691 msgid "Display current charset"
621 692 msgstr "Mostrar a tabela de caracteres ativa"
622 693  
623   -#: telnet.c:1364
  694 +#: telnet.c:1230
624 695 msgid "EOR received when not in 3270 mode, ignored."
625 696 msgstr "EOR recebido fora do modo 3270, ignorado."
626 697  
... ... @@ -668,7 +739,7 @@ msgstr &quot;Apagar até o final do campo&quot;
668 739 msgid "Erase to end of line"
669 740 msgstr "Apagar até o final da linha"
670 741  
671   -#: print.c:239 v3270/widget.c:215 util.c:1019
  742 +#: print.c:239 v3270/widget.c:215 util.c:1023
672 743 msgid "Error"
673 744 msgstr "Erro"
674 745  
... ... @@ -687,16 +758,6 @@ msgstr &quot;Erro \&quot;%s\&quot; gravando arquivo local (rc=%d)&quot;
687 758 msgid "Error %d resolving %s"
688 759 msgstr "Erro %d resolvendo %s"
689 760  
690   -#: telnet.c:3146 telnet.c:3157
691   -#, c-format
692   -msgid "Error in fcntl(%s) when setting non blocking mode"
693   -msgstr "Erro em fcntl(%s) ao ativar o modo não blocante"
694   -
695   -#: telnet.c:3136
696   -#, c-format
697   -msgid "Error in ioctl(%s) when setting no blocking mode"
698   -msgstr "Erro em ioctl(%s) ao ativar o modo não blocante"
699   -
700 761 #: dialog.c:377
701 762 #, c-format
702 763 msgid "Error loading %s"
... ... @@ -719,7 +780,7 @@ msgstr &quot;Script rexx externo&quot;
719 780 msgid "Field colors"
720 781 msgstr "Cor dos campos"
721 782  
722   -#: ft.c:185
  783 +#: ft.c:208
723 784 msgid "File transfer is already active in this session."
724 785 msgstr "Transferência de arquivos já está ativa nesta sessão."
725 786  
... ... @@ -812,11 +873,11 @@ msgstr &quot;HTTP Proxy: Resposta desconhecida&quot;
812 873 msgid "Help"
813 874 msgstr "Ajuda"
814 875  
815   -#: ft.c:534
  876 +#: ft.c:562
816 877 msgid "Host disconnected, transfer cancelled"
817 878 msgstr "Servidor desconectou, transferência cancelada"
818 879  
819   -#: telnet.c:1847
  880 +#: telnet.c:1736
820 881 msgid "Host illegally added function(s)"
821 882 msgstr "Host illegally added function(s)"
822 883  
... ... @@ -828,11 +889,11 @@ msgstr &quot;Servidor é AS/400&quot;
828 889 msgid "Host is TSO"
829 890 msgstr "Servidor é TSO"
830 891  
831   -#: telnet.c:1772
  892 +#: telnet.c:1661
832 893 msgid "Host rejected device type or request type"
833 894 msgstr "Servidor rejeitou o tipo de dispositivo ou requisição"
834 895  
835   -#: telnet.c:1785
  896 +#: telnet.c:1674
836 897 msgid "Host rejected resource(s)"
837 898 msgstr "Servidor rejeitou recurso(s)"
838 899  
... ... @@ -979,7 +1040,8 @@ msgstr &quot;Nome do arquivo destino.&quot;
979 1040 msgid "Network Trace"
980 1041 msgstr "Trace do tráfego de rede"
981 1042  
982   -#: telnet.c:360 telnet.c:688
  1043 +#: telnet.c:335 telnet.c:663 iocalls.c:428 iocalls.c:520 connect.c:86
  1044 +#: connect.c:101
983 1045 msgid "Network error"
984 1046 msgstr "Erro de rede"
985 1047  
... ... @@ -987,7 +1049,8 @@ msgstr &quot;Erro de rede&quot;
987 1049 msgid "Network keep alive"
988 1050 msgstr "Network keep alive"
989 1051  
990   -#: telnet.c:316 telnet.c:327 telnet.c:720 telnet.c:731
  1052 +#: telnet.c:291 telnet.c:302 telnet.c:695 telnet.c:706 connect.c:157
  1053 +#: connect.c:168 connect.c:323 connect.c:334
991 1054 msgid "Network startup error"
992 1055 msgstr "Erro ao iniciar a rede"
993 1056  
... ... @@ -1003,6 +1066,11 @@ msgstr &quot;&quot;
1003 1066 "Nenhuma assinatura pode ser verificada, porque a cadeia contém apenas um "
1004 1067 "certificado e não é auto assinado."
1005 1068  
  1069 +#: ft.c:97
  1070 +#, fuzzy
  1071 +msgid "No transfer in progress"
  1072 +msgstr "Erro na transferência de arquivos"
  1073 +
1006 1074 #: colors.c:454
1007 1075 msgid "Normal/Protected"
1008 1076 msgstr "Normal/Protegido"
... ... @@ -1015,7 +1083,7 @@ msgstr &quot;Normal/Desprotegido&quot;
1015 1083 msgid "Not available"
1016 1084 msgstr "Não disponível"
1017 1085  
1018   -#: ft.c:541
  1086 +#: ft.c:569
1019 1087 msgid "Not in 3270 mode, transfer cancelled"
1020 1088 msgstr "Não está no modo 3270, transferência cancelada"
1021 1089  
... ... @@ -1402,7 +1470,7 @@ msgstr &quot;&quot;
1402 1470 msgid "Remove selection"
1403 1471 msgstr "Remover seleção"
1404 1472  
1405   -#: filetransfer.c:293 filetransfer.c:338 ft.c:170 ft.c:182 ft.c:196 ft.c:215
  1473 +#: filetransfer.c:293 filetransfer.c:338 ft.c:193 ft.c:205 ft.c:219 ft.c:238
1406 1474 msgid "Request failed"
1407 1475 msgstr "Requisição falhou"
1408 1476  
... ... @@ -1546,31 +1614,32 @@ msgstr &quot;SOCKS5 Proxy: xmit version 5 nmethods 1 (no auth)\n&quot;
1546 1614 msgid "SOCKS5 proxy: %s/%u: %s"
1547 1615 msgstr "SOCKS5 proxy: %s/%u: %s"
1548 1616  
1549   -#: telnet.c:1156
  1617 +#: ssl.c:107
  1618 +#, fuzzy
  1619 +msgid "SSL Connect failed"
  1620 +msgstr "Conexão SSL falhou"
  1621 +
  1622 +#: telnet.c:1022
1550 1623 msgid "SSL Error"
1551 1624 msgstr "Erro SSL"
1552 1625  
1553   -#: telnet.c:1156
  1626 +#: telnet.c:1022
1554 1627 msgid "SSL Read error"
1555 1628 msgstr "Erro de leitura SSL"
1556 1629  
1557   -#: telnet.c:846 telnet.c:860
1558   -msgid "SSL connect failed!"
1559   -msgstr "Conexão SSL falhou"
1560   -
1561 1630 #: host.c:140
1562 1631 msgid "SSL error"
1563 1632 msgstr "Erro SSL"
1564 1633  
1565   -#: telnet.c:819
1566   -msgid "SSL init failed!"
1567   -msgstr "Inicialização SSL falhou"
  1634 +#: ssl.c:82
  1635 +msgid "SSL negotiation failed"
  1636 +msgstr "Negociação SSL falhou"
1568 1637  
1569   -#: telnet.c:828
1570   -msgid "SSL_set_fd failed!"
1571   -msgstr "SSL_set_fd falhou!"
  1638 +#: ssl.c:217
  1639 +msgid "SSL_CTX_new() has failed"
  1640 +msgstr "SSL_CTX_new() has failed"
1572 1641  
1573   -#: telnet.c:2104
  1642 +#: telnet.c:1993
1574 1643 #, c-format
1575 1644 msgid ""
1576 1645 "SSL_write:\n"
... ... @@ -1635,6 +1704,11 @@ msgstr &quot;Secondary space:&quot;
1635 1704 msgid "Secure connection was successful."
1636 1705 msgstr "Conexão segura efetuada com sucesso."
1637 1706  
  1707 +#: ssl.c:81 ssl.c:106 ssl.c:216 ssl.c:255 ssl.c:308
  1708 +#, fuzzy
  1709 +msgid "Security error"
  1710 +msgstr "Erro ao enviar dados para a rede"
  1711 +
1638 1712 #: ui/00default.xml:264
1639 1713 msgid "Select Field"
1640 1714 msgstr "Selecionar campo"
... ... @@ -1667,6 +1741,11 @@ msgstr &quot;Selecione fonte&quot;
1667 1741 msgid "Select hostname"
1668 1742 msgstr "Selecione host"
1669 1743  
  1744 +#: iocalls.c:521
  1745 +#, fuzzy
  1746 +msgid "Select() failed when processing for events."
  1747 +msgstr "select() falhou ao processar eventos"
  1748 +
1670 1749 #: colors.c:457
1671 1750 msgid "Selection background"
1672 1751 msgstr "Fundo da seleção"
... ... @@ -1747,11 +1826,16 @@ msgstr &quot;Mostrar padrão de teste&quot;
1747 1826 msgid "Smart paste"
1748 1827 msgstr "Colar inteligente"
1749 1828  
1750   -#: telnet.c:1177
  1829 +#: connect.c:552 connect.c:569
  1830 +#, fuzzy
  1831 +msgid "Socket error"
  1832 +msgstr "Erro ao ler dados da rede"
  1833 +
  1834 +#: telnet.c:1043
1751 1835 msgid "Socket read error"
1752 1836 msgstr "Erro ao ler dados da rede"
1753 1837  
1754   -#: telnet.c:2125
  1838 +#: telnet.c:2014
1755 1839 msgid "Socket write error"
1756 1840 msgstr "Erro ao enviar dados para a rede"
1757 1841  
... ... @@ -1821,7 +1905,7 @@ msgstr &quot;Tipo de servidor:&quot;
1821 1905 msgid "TELNET Proxy: send error"
1822 1906 msgstr "TELNET Proxy: Erro ao enviar"
1823 1907  
1824   -#: telnet.c:3343
  1908 +#: telnet.c:1503
1825 1909 msgid "TLS negotiation failure"
1826 1910 msgstr "Negociação TLS falhou"
1827 1911  
... ... @@ -1999,7 +2083,7 @@ msgid &quot;&quot;
1999 2083 msgstr ""
2000 2084 "The public key in the certificate SubjectPublicKeyInfo could not be read."
2001 2085  
2002   -#: ft.c:199
  2086 +#: ft.c:222
2003 2087 msgid "The remote file name is invalid."
2004 2088 msgstr "O nome do arquivo remoto não é válido."
2005 2089  
... ... @@ -2101,7 +2185,7 @@ msgstr &quot;Transferência cancelada pelo servidor&quot;
2101 2185 msgid "Transfer cancelled by user"
2102 2186 msgstr "Transferência cancelada pelo usuário"
2103 2187  
2104   -#: ft_cut.c:334
  2188 +#: ft.c:477 ft_cut.c:334
2105 2189 msgid "Transfer complete"
2106 2190 msgstr "Transferência completa"
2107 2191  
... ... @@ -2125,6 +2209,11 @@ msgstr &quot;UTF-8&quot;
2125 2209 msgid "Uknown DFT Open type from host"
2126 2210 msgstr "Host enviou código de abertura DFT desconhecido"
2127 2211  
  2212 +#: connect.c:102
  2213 +#, fuzzy
  2214 +msgid "Unable to connect to host."
  2215 +msgstr "Não é possível conectar em servidores seguros"
  2216 +
2128 2217 #: host.c:141
2129 2218 msgid "Unable to connect to secure hosts"
2130 2219 msgstr "Não é possível conectar em servidores seguros"
... ... @@ -2142,10 +2231,20 @@ msgstr &quot;&quot;
2142 2231 msgid "Unable to decrypt certificate's signature"
2143 2232 msgstr "Incapaz de decifrar a assinatura do certificado"
2144 2233  
  2234 +#: connect.c:225
  2235 +#, fuzzy
  2236 +msgid "Unable to find selected hostname."
  2237 +msgstr "Não é possível conectar em servidores seguros"
  2238 +
2145 2239 #: v3270/security.c:61
2146 2240 msgid "Unable to get certificate CRL"
2147 2241 msgstr "Unable to get certificate CRL"
2148 2242  
  2243 +#: connect.c:87
  2244 +#, fuzzy
  2245 +msgid "Unable to get connection state."
  2246 +msgstr "Unable to get certificate CRL"
  2247 +
2149 2248 #: v3270/security.c:54
2150 2249 msgid "Unable to get issuer certificate"
2151 2250 msgstr "Não foi possível obter emissor do certificado"
... ... @@ -2158,7 +2257,7 @@ msgstr &quot;Unable to get local issuer certificate&quot;
2158 2257 msgid "Unable to paste text"
2159 2258 msgstr "Incapaz de colar texto"
2160 2259  
2161   -#: ft.c:401
  2260 +#: ft.c:424
2162 2261 msgid "Unable to send file-transfer request"
2163 2262 msgstr "Não foi possível enviar a requisição de transferência de arquivo"
2164 2263  
... ... @@ -2248,12 +2347,12 @@ msgstr &quot;Unknown 3270 Data Stream command: 0x%X&quot;
2248 2347 msgid "Unknown FT control code from host"
2249 2348 msgstr "Servidor enviou código de controle FT desconhecido"
2250 2349  
2251   -#: kybd.c:2443
  2350 +#: kybd.c:2430
2252 2351 #, c-format
2253 2352 msgid "Unknown PA key %d"
2254 2353 msgstr "PA %d desconhecida"
2255 2354  
2256   -#: kybd.c:2458
  2355 +#: kybd.c:2445
2257 2356 #, c-format
2258 2357 msgid "Unknown PF key %d"
2259 2358 msgstr "PF %d desconhecida"
... ... @@ -2271,7 +2370,7 @@ msgstr &quot;&quot;
2271 2370 "Servidor desconhecido:\n"
2272 2371 "%s"
2273 2372  
2274   -#: telnet.c:551
  2373 +#: telnet.c:526
2275 2374 #, c-format
2276 2375 msgid "Unknown passthru host: %s"
2277 2376 msgstr "Servidor \"passthru\" desconhecido: %s"
... ... @@ -2281,7 +2380,7 @@ msgstr &quot;Servidor \&quot;passthru\&quot; desconhecido: %s&quot;
2281 2380 msgid "Unknown popup type \"%s\""
2282 2381 msgstr "Tipo de popup \"%s\" não é conhecido"
2283 2382  
2284   -#: telnet.c:580 resolver.c:147
  2383 +#: telnet.c:555 resolver.c:147
2285 2384 #, c-format
2286 2385 msgid "Unknown port number or service: %s"
2287 2386 msgstr "Número de porta ou serviço desconhecido: %s"
... ... @@ -2294,7 +2393,7 @@ msgstr &quot;Unsupported RPQ term&quot;
2294 2393 msgid "Unsupported certificate purpose"
2295 2394 msgstr "Finalidade do certificado não é suportada"
2296 2395  
2297   -#: telnet.c:536
  2396 +#: telnet.c:511
2298 2397 msgid "Unsupported passthru host session"
2299 2398 msgstr "Unsupported passthru host session"
2300 2399  
... ... @@ -2323,19 +2422,24 @@ msgstr &quot;Versão %s - Revisão %s&quot;
2323 2422 msgid "View Field Delimiters"
2324 2423 msgstr "Mostrar delimitadores de campo"
2325 2424  
2326   -#: telnet.c:732
  2425 +#: telnet.c:707 connect.c:335
2327 2426 msgid "WSAEventSelect failed"
2328 2427 msgstr "WSAEventSelect falhou"
2329 2428  
2330   -#: telnet.c:317
  2429 +#: telnet.c:292 connect.c:158
2331 2430 msgid "WSAStartup failed"
2332 2431 msgstr "WSAStartup falhou"
2333 2432  
2334   -#: ft.c:410
  2433 +#: iocalls.c:429
  2434 +#, fuzzy
  2435 +msgid "WaitForMultipleObjects() failed when processing for events."
  2436 +msgstr "select() falhou ao processar eventos"
  2437 +
  2438 +#: ft.c:433
2335 2439 msgid "Waiting for GET response"
2336 2440 msgstr "Aguardando resposta do pedido de download"
2337 2441  
2338   -#: ft.c:412
  2442 +#: ft.c:435
2339 2443 msgid "Waiting for PUT response"
2340 2444 msgstr "Aguardando resposta do pedido de upload"
2341 2445  
... ... @@ -2359,6 +2463,11 @@ msgstr &quot;Janela&quot;
2359 2463 msgid "Windows Western languages (CP1252)"
2360 2464 msgstr "Windows ocidental (CP1252)"
2361 2465  
  2466 +#: util.c:159
  2467 +#, fuzzy, c-format
  2468 +msgid "Windows error %d"
  2469 +msgstr "Erro desconhecido"
  2470 +
2362 2471 #: v3270/oia.c:424 v3270/oia.c:448 v3270/oia.c:452
2363 2472 msgid "X"
2364 2473 msgstr "X"
... ... @@ -2520,24 +2629,32 @@ msgstr &quot;um atributo \&quot;action\&quot;&quot;
2520 2629 msgid "bracket"
2521 2630 msgstr "bracket"
2522 2631  
2523   -#: toggles.c:177 telnet.c:670
  2632 +#: toggles.c:177 telnet.c:645 connect.c:386 connect.c:438
2524 2633 msgid "disable"
2525 2634 msgstr "desabilitar"
2526 2635  
2527   -#: toggles.c:177 telnet.c:670
  2636 +#: toggles.c:177 telnet.c:645 connect.c:386 connect.c:438
2528 2637 msgid "enable"
2529 2638 msgstr "enable"
2530 2639  
2531   -#: iocalls.c:450
2532   -msgid "select() failed when dispatching events"
2533   -msgstr "select() falhou ao processar eventos"
  2640 +#: connect.c:553
  2641 +msgid "fcntl() error when getting socket state."
  2642 +msgstr "fcntl() error when getting socket state."
2534 2643  
2535   -#: telnet.c:631 telnet.c:638
  2644 +#: connect.c:349 connect.c:541
  2645 +msgid "ioctlsocket(FIONBIO) failed."
  2646 +msgstr "ioctlsocket(FIONBIO) failed."
  2647 +
  2648 +#: telnet.c:606 telnet.c:613
2536 2649 #, c-format
2537 2650 msgid "setsockopt(%s)"
2538 2651 msgstr "setsockopt(%s)"
2539 2652  
2540   -#: telnet.c:624
  2653 +#: connect.c:376 connect.c:428
  2654 +msgid "setsockopt(SO_OOBINLINE) has failed"
  2655 +msgstr "setsockopt(SO_OOBINLINE) has failed"
  2656 +
  2657 +#: telnet.c:599
2541 2658 msgid "socket"
2542 2659 msgstr "socket"
2543 2660  
... ... @@ -2545,10 +2662,19 @@ msgstr &quot;socket&quot;
2545 2662 msgid "translator-credits"
2546 2663 msgstr "translator-credits"
2547 2664  
2548   -#: telnet.c:1152
  2665 +#: telnet.c:1018
2549 2666 msgid "unknown error"
2550 2667 msgstr "Erro desconhecido"
2551 2668  
  2669 +#~ msgid "Error in ioctl(%s) when setting no blocking mode"
  2670 +#~ msgstr "Erro em ioctl(%s) ao ativar o modo não blocante"
  2671 +
  2672 +#~ msgid "SSL init failed!"
  2673 +#~ msgstr "Inicialização SSL falhou"
  2674 +
  2675 +#~ msgid "SSL_set_fd failed!"
  2676 +#~ msgstr "SSL_set_fd falhou!"
  2677 +
2552 2678 #~ msgid "Add _CR at end of line."
2553 2679 #~ msgstr "Adicionar/Remover _CR no final da linha."
2554 2680  
... ... @@ -2587,9 +2713,6 @@ msgstr &quot;Erro desconhecido&quot;
2587 2713 #~ msgid "File transfer"
2588 2714 #~ msgstr "Transferência de arquivos"
2589 2715  
2590   -#~ msgid "File transfer error"
2591   -#~ msgstr "Erro na transferência de arquivos"
2592   -
2593 2716 #~ msgid "LRECL:"
2594 2717 #~ msgstr "LRECL:"
2595 2718  
... ... @@ -2672,12 +2795,6 @@ msgstr &quot;Erro desconhecido&quot;
2672 2795 #~ "<b>Unexpected SSL status %ld</b>\n"
2673 2796 #~ "Security status is undefined"
2674 2797  
2675   -#~ msgid "SSL Connect error"
2676   -#~ msgstr "Erro na conexão SSL"
2677   -
2678   -#~ msgid "Can't set SSL socket file descriptor"
2679   -#~ msgstr "Não foi possível definir o descritor de socket SSL"
2680   -
2681 2798 #~ msgid "Connection failed"
2682 2799 #~ msgstr "Conexão falhou"
2683 2800  
... ... @@ -2688,9 +2805,6 @@ msgstr &quot;Erro desconhecido&quot;
2688 2805 #~ "Quanto ativo o pw3270 response à uma consulta \"color\" com uma lista de "
2689 2806 #~ "apenas 8 cores."
2690 2807  
2691   -#~ msgid "SSL negotiation failed"
2692   -#~ msgstr "Negociação SSL falhou"
2693   -
2694 2808 #~ msgid "Copiar tudo"
2695 2809 #~ msgstr "Copiar tudo"
2696 2810  
... ...
src/include/lib3270.h
... ... @@ -401,12 +401,12 @@
401 401 * Set host id for the connect/reconnect operations.
402 402 *
403 403 * @param h Session handle.
404   - * @param n Host ID to set.
  404 + * @param url URL of host to set in the format tn3270://hostname:service ou tn3270s://hostname:service .
405 405 *
406   - * @return Pointer to host id set (internal data, do not change it)
  406 + * @return Processed host url
407 407 *
408 408 */
409   - LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n);
  409 + LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *url);
410 410  
411 411 /**
412 412 * Get host id for the connect/reconnect operations.
... ... @@ -1040,6 +1040,7 @@
1040 1040 LIB3270_EXPORT const char * lib3270_get_revision(void);
1041 1041  
1042 1042 LIB3270_EXPORT char * lib3270_vsprintf(const char *fmt, va_list args);
  1043 + LIB3270_EXPORT char * lib3270_strdup_printf(const char *fmt, ...);
1043 1044  
1044 1045 LIB3270_EXPORT int lib3270_clear_operator_error(H3270 *hSession);
1045 1046  
... ...
src/include/lib3270/session.h
... ... @@ -129,7 +129,7 @@
129 129 } toggle[LIB3270_TOGGLE_COUNT];
130 130  
131 131 // Network & Termtype
132   - char * hostname;
  132 +// char * hostname;
133 133 char * connected_type;
134 134 char * connected_lu;
135 135 char luname[LIB3270_LUNAME_LENGTH+1];
... ... @@ -139,9 +139,15 @@
139 139 int model_num;
140 140 char * termtype;
141 141  
142   - char * current_host; /**< the hostname part, stripped of qualifiers, luname and port number */
143   - char * full_current_host; /**< the entire string, for use in reconnecting */
144   - char * qualified_host;
  142 + struct
  143 + {
  144 + LIB3270_CONNECT_OPTION opt; /**< Connect options */
  145 + char * current; /**< The hostname part, stripped of qualifiers, luname and port number */
  146 + char * full; /**< The entire string, for use in reconnecting */
  147 + char * srvc; /**< The service name */
  148 + char * qualified;
  149 + } host;
  150 +
145 151 char * proxy; /**< Proxy server (type:host[:port]) */
146 152 char * termname;
147 153  
... ...
src/include/pw3270.h
... ... @@ -52,7 +52,7 @@
52 52  
53 53  
54 54 LIB3270_EXPORT GtkWidget * pw3270_new(const gchar *host, const gchar *systype, unsigned short colors);
55   - LIB3270_EXPORT void pw3270_set_host(GtkWidget *widget, const gchar *uri);
  55 + LIB3270_EXPORT const gchar * pw3270_set_host(GtkWidget *widget, const gchar *uri);
56 56 LIB3270_EXPORT const gchar * pw3270_get_host(GtkWidget *widget);
57 57 LIB3270_EXPORT void pw3270_connect_host(GtkWidget *widget, const gchar *uri);
58 58  
... ...
src/include/pw3270/v3270.h
... ... @@ -213,7 +213,7 @@
213 213 LIB3270_EXPORT void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on);
214 214 LIB3270_EXPORT void v3270_set_session_options(GtkWidget *widget, LIB3270_OPTION options);
215 215 LIB3270_EXPORT int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype);
216   - LIB3270_EXPORT void v3270_set_host(GtkWidget *widget, const gchar *uri);
  216 + LIB3270_EXPORT const gchar * v3270_set_host(GtkWidget *widget, const gchar *uri);
217 217 LIB3270_EXPORT const gchar * v3270_get_host(GtkWidget *widget);
218 218 LIB3270_EXPORT GtkWidget * v3270_get_default_widget(void);
219 219  
... ...
src/lib3270/connect.c
... ... @@ -201,6 +201,19 @@ static void net_connected(H3270 *hSession)
201 201 sockstart(hSession);
202 202 #endif
203 203  
  204 + hSession->host.opt = opt;
  205 + Replace(hSession->host.current,strdup(hostname));
  206 +
  207 + Replace(hSession->host.full,
  208 + lib3270_strdup_printf(
  209 + "%s%s:%s",
  210 + opt&LIB3270_CONNECT_OPTION_SSL ? "L:" : "",
  211 + hostname,
  212 + srvc ));
  213 +
  214 + trace("current_host=\"%s\"",hSession->host.current);
  215 +
  216 +
204 217 set_ssl_state(hSession,LIB3270_SSL_UNSECURE);
205 218  
206 219 hSession->ever_3270 = False;
... ... @@ -231,7 +244,8 @@ static void net_connected(H3270 *hSession)
231 244 hostname = name;
232 245 }
233 246  
234   - status_changed(hSession,LIB3270_STATUS_RESOLVING);
  247 + hSession->cstate = LIB3270_RESOLVING;
  248 + lib3270_st_changed(hSession, LIB3270_STATE_RESOLVING, True);
235 249  
236 250 s = getaddrinfo(hostname, srvc, &hints, &result);
237 251  
... ... @@ -286,15 +300,25 @@ static void net_connected(H3270 *hSession)
286 300 (void) fcntl(hSession->sock, F_SETFD, 1);
287 301 #endif
288 302  
289   - hSession->ssl_host = 0;
  303 + hSession->ever_3270 = False;
  304 + hSession->ssl_host = 0;
290 305  
291   -#if defined(HAVE_LIBSSL)
292 306 if(opt&LIB3270_CONNECT_OPTION_SSL)
293 307 {
  308 +#if defined(HAVE_LIBSSL)
294 309 hSession->ssl_host = 1;
295 310 ssl_init(hSession);
  311 +#else
  312 + lib3270_popup_dialog( hSession,
  313 + LIB3270_NOTIFY_ERROR,
  314 + _( "SSL error" ),
  315 + _( "Unable to connect to secure hosts" ),
  316 + _( "This version of %s was built without support for secure sockets layer (SSL)." ),
  317 + PACKAGE_NAME));
  318 +
  319 + return EINVAL;
  320 +#endif // HAVE_LIBSSL
296 321 }
297   -#endif
298 322  
299 323 /* connect */
300 324 status_connecting(hSession,1);
... ...
src/lib3270/host.c
... ... @@ -38,6 +38,7 @@
38 38 * connection.
39 39 */
40 40  
  41 +#include <malloc.h>
41 42 #include "globals.h"
42 43 // #include "appres.h"
43 44 #include "resources.h"
... ... @@ -64,7 +65,7 @@ static void try_reconnect(H3270 *session);
64 65 * Returns the hostname part in a newly-malloc'd string.
65 66 * 'needed' is returned True if anything was actually stripped.
66 67 * Returns NULL if there is a syntax error.
67   - */
  68 + */ /*
68 69 static char *
69 70 split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
70 71 char *non_e, char *secure, char *no_login, char *xluname,
... ... @@ -85,18 +86,18 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
85 86  
86 87 *needed = False;
87 88  
88   - /*
89   - * Hostname syntax is:
90   - * Zero or more optional prefixes (A:, S:, P:, N:, L:, C:).
91   - * An optional LU name separated by '@'.
92   - * A hostname optionally in square brackets (which quote any colons
93   - * in the name).
94   - * An optional port name or number separated from the hostname by a
95   - * space or colon.
96   - * No additional white space or colons are allowed.
97   - */
98   -
99   - /* Strip leading whitespace. */
  89 + //
  90 + // Hostname syntax is:
  91 + // Zero or more optional prefixes (A:, S:, P:, N:, L:, C:).
  92 + // An optional LU name separated by '@'.
  93 + // A hostname optionally in square brackets (which quote any colons
  94 + // in the name).
  95 + // An optional port name or number separated from the hostname by a
  96 + // space or colon.
  97 + // No additional white space or colons are allowed.
  98 + //
  99 +
  100 + // Strip leading whitespace.
100 101 while (*s && isspace(*s))
101 102 s++;
102 103  
... ... @@ -106,11 +107,11 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
106 107 goto split_fail;
107 108 }
108 109  
109   - /* Strip trailing whitespace. */
  110 + // Strip trailing whitespace.
110 111 while (isspace(*(s + strlen(s) - 1)))
111 112 *(s + strlen(s) - 1) = '\0';
112 113  
113   - /* Start with the prefixes. */
  114 + // Start with the prefixes.
114 115 while (*s && *(s + 1) && isalpha(*s) && *(s + 1) == ':') {
115 116 switch (*s) {
116 117 case 'a':
... ... @@ -160,12 +161,12 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
160 161 *needed = True;
161 162 s += 2;
162 163  
163   - /* Allow whitespace around the prefixes. */
  164 + // Allow whitespace around the prefixes.
164 165 while (*s && isspace(*s))
165 166 s++;
166 167 }
167 168  
168   - /* Process the LU name. */
  169 + // Process the LU name.
169 170 lbracket = strchr(s, '[');
170 171 at = strchr(s, '@');
171 172 if (at != CN && lbracket != CN && at > lbracket)
... ... @@ -203,15 +204,15 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
203 204 *needed = True;
204 205 }
205 206  
206   - /*
207   - * Isolate the hostname.
208   - * At this point, we've found its start, so we can malloc the buffer
209   - * that will hold the copy.
210   - */
  207 + //
  208 + // Isolate the hostname.
  209 + // At this point, we've found its start, so we can malloc the buffer
  210 + // that will hold the copy.
  211 + ///
211 212 if (lbracket != CN) {
212 213 char *rbracket;
213 214  
214   - /* Check for junk before the '['. */
  215 + // Check for junk before the '['.
215 216 if (lbracket != s) {
216 217 popup_system_error(hSession,NULL,_("Hostname syntax error"),"%s",_("Text before '['"));
217 218 goto split_fail;
... ... @@ -219,10 +220,10 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
219 220  
220 221 s = r = NewString(lbracket + 1);
221 222  
222   - /*
223   - * Take whatever is inside square brackets, including
224   - * whitespace, unmodified -- except for empty strings.
225   - */
  223 + //
  224 + // Take whatever is inside square brackets, including
  225 + // whitespace, unmodified -- except for empty strings.
  226 + //
226 227 rbracket = strchr(s, ']');
227 228 if (rbracket == CN) {
228 229 popup_system_error(hSession,NULL,_("Hostname syntax error"),"%s",_("Missing ']'"));
... ... @@ -234,7 +235,7 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
234 235 }
235 236 *rbracket = '\0';
236 237  
237   - /* Skip over any whitespace after the bracketed name. */
  238 + // Skip over any whitespace after the bracketed name.
238 239 s = rbracket + 1;
239 240 while (*s && isspace(*s))
240 241 s++;
... ... @@ -244,7 +245,7 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
244 245 } else {
245 246 char *name_end;
246 247  
247   - /* Check for an empty string. */
  248 + // Check for an empty string.
248 249 if (!*s || *s == ':') {
249 250 popup_an_error(hSession,"Empty hostname");
250 251 goto split_fail;
... ... @@ -252,19 +253,19 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
252 253  
253 254 s = r = NewString(s);
254 255  
255   - /* Find the end of the hostname. */
  256 + // Find the end of the hostname.
256 257 while (*s && !isspace(*s) && *s != ':')
257 258 s++;
258 259 name_end = s;
259 260  
260   - /* If the terminator is whitespace, skip the rest of it. */
  261 + // If the terminator is whitespace, skip the rest of it.
261 262 while (*s && isspace(*s))
262 263 s++;
263 264  
264   - /*
265   - * If there's nothing but whitespace (or nothing) after the
266   - * name, we're done.
267   - */
  265 + //
  266 + // If there's nothing but whitespace (or nothing) after the
  267 + // name, we're done.
  268 + //
268 269 if (*s == '\0') {
269 270 *name_end = '\0';
270 271 goto split_success;
... ... @@ -273,10 +274,10 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
273 274 *name_end = '\0';
274 275 }
275 276  
276   - /*
277   - * If 'colon' is set, 's' points at it (or where it was). Skip
278   - * it and any whitespace that follows.
279   - */
  277 + //
  278 + // If 'colon' is set, 's' points at it (or where it was). Skip
  279 + // it and any whitespace that follows.
  280 + //
280 281 if (colon) {
281 282 s++;
282 283 while (*s && isspace(*s))
... ... @@ -287,11 +288,11 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru,
287 288 }
288 289 }
289 290  
290   - /*
291   - * Set the portname and find its end.
292   - * Note that trailing spaces were already stripped, so the end of the
293   - * portname must be a NULL.
294   - */
  291 + //
  292 + // Set the portname and find its end.
  293 + // Note that trailing spaces were already stripped, so the end of the
  294 + // portname must be a NULL.
  295 + //
295 296 *port = s;
296 297 *needed = True;
297 298 while (*s && !isspace(*s) && *s != ':')
... ... @@ -309,23 +310,25 @@ split_fail:
309 310 split_success:
310 311 return r;
311 312 }
  313 +*/
312 314  
313   -static int do_connect(H3270 *hSession, const char *n)
  315 +static int do_connect(H3270 *hSession)
314 316 {
315   - char nb[2048]; /* name buffer */
316   - char *s; /* temporary */
317   - char *chost = NULL; /* to whom we will connect */
  317 +// char nb[2048]; // name buffer
  318 +// char *s; // temporary
  319 + char *chost = NULL; // to whom we will connect
318 320 // char *ps = CN;
319   - char *port = CN;
  321 +// char *port = CN;
320 322 Boolean resolving;
321 323 Boolean pending;
322   - static Boolean ansi_host;
323   - Boolean has_colons = False;
  324 +// static Boolean ansi_host;
  325 +// Boolean has_colons = False;
324 326  
325 327 if (lib3270_connected(hSession) || hSession->auto_reconnect_inprogress)
326 328 return EBUSY;
327 329  
328   - /* Skip leading blanks. */
  330 + /*
  331 + // Skip leading blanks.
329 332 while (*n == ' ')
330 333 n++;
331 334  
... ... @@ -334,22 +337,26 @@ static int do_connect(H3270 *hSession, const char *n)
334 337 popup_an_error(hSession,_( "Invalid (empty) hostname" ));
335 338 return -1;
336 339 }
  340 + */
337 341  
338   - /* Save in a modifiable buffer. */
  342 + /*
  343 + // Save in a modifiable buffer.
339 344 (void) strncpy(nb, n, 2047);
340 345  
341   - /* Strip trailing blanks. */
  346 + // Strip trailing blanks.
342 347 s = nb + strlen(nb) - 1;
343 348 while (*s == ' ')
344 349 *s-- = '\0';
  350 + */
345 351  
346 352 /* Remember this hostname, as the last hostname we connected to. */
347   - lib3270_set_host(hSession,nb);
  353 + // lib3270_set_host(hSession,nb);
348 354  
  355 + /*
349 356 {
350 357 Boolean needed;
351 358  
352   - /* Strip off and remember leading qualifiers. */
  359 + // Strip off and remember leading qualifiers.
353 360 if ((s = split_host(hSession, nb, &ansi_host, &hSession->std_ds_host,
354 361 &hSession->passthru_host, &hSession->non_tn3270e_host, &hSession->ssl_host,
355 362 &hSession->no_login_host, hSession->luname, &port,
... ... @@ -358,35 +365,52 @@ static int do_connect(H3270 *hSession, const char *n)
358 365  
359 366 chost = s;
360 367  
361   - /* Default the port. */
  368 + // Default the port.
362 369 if (port == CN)
363 370 port = "telnet";
364 371 }
365 372  
366   - /*
367   - * Store the original name in globals, even if we fail the connect
368   - * later:
369   - * current_host is the hostname part, stripped of qualifiers, luname
370   - * and port number
371   - * full_current_host is the entire string, for use in reconnecting
372   - */
373   - Replace(hSession->current_host, CN);
  373 + //
  374 + // Store the original name in globals, even if we fail the connect
  375 + // later:
  376 + // current_host is the hostname part, stripped of qualifiers, luname
  377 + // and port number
  378 + // full_current_host is the entire string, for use in reconnecting
  379 + //
  380 + //
  381 + // Replace(hSession->current_host, CN);
374 382  
375 383 has_colons = (strchr(chost, ':') != NULL);
376 384  
377   - Replace(hSession->qualified_host,
  385 + Replace(hSession->host.qualified,
378 386 xs_buffer("%s%s%s%s:%s",
379 387 hSession->ssl_host? "L:": "",
380 388 has_colons? "[": "",
381 389 chost,
382 390 has_colons? "]": "",
383 391 port));
384   -
  392 + */
385 393  
386 394 /* Attempt contact. */
387 395 hSession->ever_3270 = False;
  396 + hSession->ssl_host = 0;
388 397  
389   - if(net_connect(hSession, chost, port, 0, &resolving,&pending) != 0 && !resolving)
  398 + if(hSession->host.opt&LIB3270_CONNECT_OPTION_SSL)
  399 + {
  400 +#if defined(HAVE_LIBSSL)
  401 + hSession->ssl_host = 1;
  402 + ssl_init(hSession);
  403 +#else
  404 + popup_system_error(hSession, _( "SSL error" ),
  405 + _( "Unable to connect to secure hosts" ),
  406 + _( "This version of %s was built without support for secure sockets layer (SSL)." ),
  407 + PACKAGE_NAME
  408 + );
  409 +#endif
  410 + }
  411 +
  412 + trace("Conneting to hostname=[%s] service=[%s]",hSession->host.current, hSession->host.srvc);
  413 + if(net_connect(hSession, hSession->host.current, hSession->host.srvc, 0, &resolving,&pending) != 0 && !resolving)
390 414 {
391 415 /* Redundantly signal a disconnect. */
392 416 lib3270_set_disconnected(hSession);
... ... @@ -457,14 +481,13 @@ int lib3270_connect(H3270 *hSession, const char *n, int wait)
457 481 if(PCONNECTED)
458 482 return EBUSY;
459 483  
460   - if(!n)
461   - {
462   - n = hSession->full_current_host;
463   - if(!n)
464   - return EINVAL;
465   - }
  484 + if(n)
  485 + lib3270_set_host(hSession,n);
466 486  
467   - rc = do_connect(hSession,n);
  487 + if(!hSession->host.full)
  488 + return EINVAL;
  489 +
  490 + rc = do_connect(hSession);
468 491 if(rc)
469 492 return rc;
470 493  
... ... @@ -489,7 +512,7 @@ int lib3270_connect(H3270 *hSession, const char *n, int wait)
489 512 */
490 513 static void try_reconnect(H3270 *session)
491 514 {
492   - lib3270_write_log(session,"3270","Starting auto-reconnect (Host: %s)",session->full_current_host ? session->full_current_host : "-");
  515 + lib3270_write_log(session,"3270","Starting auto-reconnect (Host: %s)",session->host.full ? session->host.full : "-");
493 516 session->auto_reconnect_inprogress = 0;
494 517 lib3270_reconnect(session,0);
495 518 }
... ... @@ -626,26 +649,88 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n)
626 649 {
627 650 CHECK_SESSION_HANDLE(h);
628 651  
629   - if(n && n != h->full_current_host)
  652 + if(n && n != h->host.full)
630 653 {
631   - char *new_hostname = strdup(n);
  654 + static const struct _sch
  655 + {
  656 + LIB3270_CONNECT_OPTION opt;
  657 + const char * text;
  658 + const char * srvc;
  659 + } sch[] =
  660 + {
  661 + { LIB3270_CONNECT_OPTION_DEFAULTS, "tn3270://", "telnet" },
  662 + { LIB3270_CONNECT_OPTION_SSL, "tn3270s://", "telnets" },
  663 + { LIB3270_CONNECT_OPTION_DEFAULTS, "telnet://", "telnet" },
  664 + { LIB3270_CONNECT_OPTION_DEFAULTS, "telnets://", "telnets" },
  665 + { LIB3270_CONNECT_OPTION_SSL, "L://", "telnets" },
  666 +
  667 + { LIB3270_CONNECT_OPTION_SSL, "L:", "telnets" } // The compatibility should be the last option
  668 + };
  669 +
  670 + char * str = strdup(n);
  671 + char * hostname = str;
  672 + const char * srvc = "telnet";
  673 + char * ptr;
  674 + char * query = "";
  675 + int f;
  676 +
  677 + trace("%s(%s)",__FUNCTION__,str);
  678 + h->host.opt = LIB3270_CONNECT_OPTION_DEFAULTS;
  679 +
  680 + for(f=0;f < sizeof(sch)/sizeof(sch[0]);f++)
  681 + {
  682 + size_t sz = strlen(sch[f].text);
  683 + if(!strncasecmp(hostname,sch[f].text,sz))
  684 + {
  685 + h->host.opt = sch[f].opt;
  686 + srvc = sch[f].srvc;
  687 + hostname += sz;
  688 + break;
  689 + }
  690 + }
632 691  
633   - trace("new hostname is \"%s\"",new_hostname);
  692 + trace("SRVC=[%s]",srvc);
634 693  
635   - if(h->full_current_host)
636   - lib3270_free(h->full_current_host);
  694 + if(!*hostname)
  695 + return h->host.current;
637 696  
638   - h->full_current_host = new_hostname;
  697 + ptr = strchr(hostname,':');
  698 + if(ptr)
  699 + {
  700 + *(ptr++) = 0;
  701 + srvc = ptr;
  702 + query = strchr(ptr,'?');
  703 +
  704 + trace("QUERY=[%s]",query);
  705 +
  706 + if(query)
  707 + *(query++) = 0;
  708 + else
  709 + query = "";
  710 + }
639 711  
  712 + Replace(h->host.current,strdup(hostname));
  713 + Replace(h->host.srvc,strdup(srvc));
  714 + Replace(h->host.full,
  715 + lib3270_strdup_printf(
  716 + "%s%s:%s%s%s",
  717 + h->host.opt&LIB3270_CONNECT_OPTION_SSL ? "L:" : "",
  718 + hostname,
  719 + srvc,
  720 + *query ? "?" : "",
  721 + query
  722 + ));
  723 +
  724 + free(str);
640 725 }
641 726  
642   - return h->full_current_host;
  727 + return h->host.current;
643 728 }
644 729  
645 730 LIB3270_EXPORT const char * lib3270_get_host(H3270 *h)
646 731 {
647 732 CHECK_SESSION_HANDLE(h);
648   - return h->full_current_host;
  733 + return h->host.full;
649 734 }
650 735  
651 736 LIB3270_EXPORT int lib3270_reconnect(H3270 *hSession,int wait)
... ... @@ -657,13 +742,13 @@ LIB3270_EXPORT int lib3270_reconnect(H3270 *hSession,int wait)
657 742 if (CONNECTED || HALF_CONNECTED)
658 743 return EBUSY;
659 744  
660   - if (hSession->full_current_host == CN)
  745 + if (hSession->host.full == CN)
661 746 return EINVAL;
662 747  
663 748 if (hSession->auto_reconnect_inprogress)
664 749 return EBUSY;
665 750  
666   - rc = lib3270_connect(hSession,hSession->full_current_host,wait);
  751 + rc = lib3270_connect(hSession,hSession->host.full,wait);
667 752  
668 753 if(rc)
669 754 {
... ...
src/lib3270/session.c
... ... @@ -99,6 +99,13 @@ void lib3270_session_free(H3270 *h)
99 99 if(h == default_session)
100 100 default_session = NULL;
101 101  
  102 +
  103 + // Release hostname info
  104 + release_pointer(h->host.current);
  105 + release_pointer(h->host.full);
  106 + release_pointer(h->host.srvc);
  107 + release_pointer(h->host.qualified);
  108 +
102 109 lib3270_free(h);
103 110  
104 111 }
... ...
src/lib3270/telnet.c
... ... @@ -501,7 +501,7 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo
501 501 *resolving = False;
502 502 *pending = False;
503 503  
504   - Replace(session->hostname, NewString(host));
  504 +// Replace(session->hostname, NewString(host));
505 505  
506 506 /* get the passthru host and port number */
507 507 if (session->passthru_host)
... ... @@ -656,7 +656,7 @@ int net_connect(H3270 *session, const char *host, char *portname, Boolean ls, Bo
656 656 }
657 657 else
658 658 {
659   - char *msg = xs_buffer( _( "Can't connect to %s:%d" ), session->hostname, session->current_port);
  659 + char *msg = xs_buffer( _( "Can't connect to %s" ), session->host.current);
660 660  
661 661 lib3270_popup_dialog( session,
662 662 LIB3270_NOTIFY_ERROR,
... ... @@ -778,9 +778,10 @@ static void setup_lus(H3270 *hSession)
778 778  
779 779 static int net_connected(H3270 *hSession)
780 780 {
  781 + /*
781 782 if(hSession->proxy_type > 0)
782 783 {
783   - /* Negotiate with the proxy. */
  784 + // Negotiate with the proxy.
784 785 trace_dsn(hSession,"Connected to proxy server %s, port %u.\n",hSession->proxy_host, hSession->proxy_port);
785 786  
786 787 if (proxy_negotiate(hSession, hSession->proxy_type, hSession->sock, hSession->hostname,hSession->current_port) < 0)
... ... @@ -789,8 +790,9 @@ static int net_connected(H3270 *hSession)
789 790 return -1;
790 791 }
791 792 }
  793 + */
792 794  
793   - trace_dsn(hSession,"Connected to %s, port %u%s.\n", hSession->hostname, hSession->current_port,hSession->ssl_host? " via SSL": "");
  795 + trace_dsn(hSession,"Connected to %s%s.\n", hSession->host.current,hSession->ssl_host? " using SSL": "");
794 796  
795 797 #if defined(HAVE_LIBSSL)
796 798 /* Set up SSL. */
... ... @@ -847,6 +849,7 @@ LIB3270_EXPORT void lib3270_setup_session(H3270 *hSession)
847 849 check_linemode(hSession,True);
848 850  
849 851 /* write out the passthru hostname and port nubmer */
  852 + /*
850 853 if (hSession->passthru_host)
851 854 {
852 855 unsigned char *buffer = (unsigned char *) xs_buffer("%s %d\r\n", hSession->hostname, hSession->current_port);
... ... @@ -854,6 +857,7 @@ LIB3270_EXPORT void lib3270_setup_session(H3270 *hSession)
854 857 lib3270_free(buffer);
855 858 trace_ds(hSession,"SENT HOSTNAME %s:%d\n", hSession->hostname, hSession->current_port);
856 859 }
  860 + */
857 861 }
858 862  
859 863 /**
... ... @@ -1036,7 +1040,7 @@ void net_input(H3270 *hSession)
1036 1040  
1037 1041 if (HALF_CONNECTED)
1038 1042 {
1039   - popup_a_sockerr(hSession, N_( "%s:%d" ),hSession->hostname, hSession->current_port);
  1043 + popup_a_sockerr(hSession, N_( "%s" ),hSession->host.current);
1040 1044 }
1041 1045 else if (socket_errno() != SE_ECONNRESET)
1042 1046 {
... ...
src/lib3270/testprogram.c
... ... @@ -22,7 +22,7 @@ static void * mainloop(void *dunno)
22 22 int main(int numpar, char *param[])
23 23 {
24 24 H3270 * h;
25   - int rc;
  25 + int rc = 0;
26 26 // char line[4096];
27 27 // pthread_t thread;
28 28  
... ... @@ -37,7 +37,10 @@ int main(int numpar, char *param[])
37 37 // pthread_detach(thread);
38 38  
39 39 // rc = lib3270_connect_host(h, "fandezhi.efglobe.com", "telnet", LIB3270_CONNECT_OPTION_WAIT);
40   - rc = lib3270_connect_host(h, "127.0.0.1", "9090", LIB3270_CONNECT_OPTION_WAIT);
  40 +// rc = lib3270_connect_host(h, "127.0.0.1", "9090", LIB3270_CONNECT_OPTION_WAIT);
  41 +
  42 +// lib3270_set_host_url(h,"tn3270://fandezhi.efglobe.com:9090?lu=default");
  43 + lib3270_set_host(h,"tn3270://fandezhi.efglobe.com");
41 44  
42 45 printf("\nConnect exits with rc=%d\n",rc);
43 46  
... ...
src/lib3270/util.c
... ... @@ -237,6 +237,17 @@ char * lib3270_vsprintf(const char *fmt, va_list args)
237 237 #endif /*]*/
238 238 }
239 239  
  240 +LIB3270_EXPORT char * lib3270_strdup_printf(const char *fmt, ...)
  241 +{
  242 + va_list args;
  243 + char *r;
  244 +
  245 + va_start(args, fmt);
  246 + r = lib3270_vsprintf(fmt, args);
  247 + va_end(args);
  248 + return r;
  249 +}
  250 +
240 251 /*
241 252 * Common helper functions to insert strings, through a template, into a new
242 253 * buffer.
... ... @@ -280,77 +291,6 @@ xs_error(const char *fmt, ...)
280 291 lib3270_free(r);
281 292 }
282 293  
283   -/* Prettyprinter for strings with unprintable data. */ /*
284   -void
285   -fcatv(FILE *f, char *s)
286   -{
287   - char c;
288   -
289   - while ((c = *s++)) {
290   - switch (c) {
291   - case '\n':
292   - (void) fprintf(f, "\\n");
293   - break;
294   - case '\t':
295   - (void) fprintf(f, "\\t");
296   - break;
297   - case '\b':
298   - (void) fprintf(f, "\\b");
299   - break;
300   - default:
301   - if ((c & 0x7f) < ' ')
302   - (void) fprintf(f, "\\%03o", c & 0xff);
303   - else
304   - fputc(c, f);
305   - break;
306   - }
307   - }
308   -}
309   -*/
310   -
311   -/* String version of fcatv. */ /*
312   -char *
313   -scatv(const char *s, char *buf, size_t len)
314   -{
315   - char c;
316   - char *dst = buf;
317   -
318   - while ((c = *s++) && len > 0) {
319   - char cbuf[5];
320   - char *t = cbuf;
321   -
322   - // Expand this character.
323   - switch (c) {
324   - case '\n':
325   - (void) strcpy(cbuf, "\\n");
326   - break;
327   - case '\t':
328   - (void) strcpy(cbuf, "\\t");
329   - break;
330   - case '\b':
331   - (void) strcpy(cbuf, "\\b");
332   - break;
333   - default:
334   - if ((c & 0x7f) < ' ')
335   - (void) sprintf(cbuf, "\\%03o", c & 0xff);
336   - else {
337   - cbuf[0] = c;
338   - cbuf[1] = '\0';
339   - }
340   - break;
341   - }
342   - // Copy as much as will fit.
343   - while ((c = *t++) && len > 0) {
344   - *dst++ = c;
345   - len--;
346   - }
347   - }
348   - if (len > 0)
349   - *dst = '\0';
350   -
351   - return buf;
352   -}
353   -*/
354 294  
355 295 /*
356 296 * Definition resource splitter, for resources of the repeating form:
... ...
src/pw3270/v3270/widget.c
... ... @@ -57,6 +57,15 @@
57 57 #define CONTENTS_WIDTH(terminal) (cols * terminal->metrics.width)
58 58 #define CONTENTS_HEIGHT(terminal) (((rows+1) * terminal->metrics.spacing)+OIA_TOP_MARGIN+2)
59 59  
  60 +/**
  61 + * SECTION: v3270
  62 + * @title: Virtual 3270 widget
  63 + * @short_description: The virtual 3270 terminal widget.
  64 + *
  65 + * Common functions for interact with the 3270 virtual terminal widget.
  66 + *
  67 + */
  68 +
60 69 /*--[ Widget definition ]----------------------------------------------------------------------------*/
61 70  
62 71 G_DEFINE_TYPE(v3270, v3270, GTK_TYPE_WIDGET);
... ... @@ -721,7 +730,7 @@ static void update_connect(H3270 *session, unsigned char connected)
721 730 if(connected)
722 731 {
723 732 widget->cursor.show |= 2;
724   - g_signal_emit(GTK_WIDGET(widget), v3270_widget_signal[SIGNAL_CONNECTED], 0, session->full_current_host);
  733 + g_signal_emit(GTK_WIDGET(widget), v3270_widget_signal[SIGNAL_CONNECTED], 0, session->host.full);
725 734 }
726 735 else
727 736 {
... ... @@ -1380,18 +1389,71 @@ H3270 * v3270_get_session(GtkWidget *widget)
1380 1389 return GTK_V3270(widget)->host;
1381 1390 }
1382 1391  
1383   -int v3270_connect(GtkWidget *widget, const gchar *host)
  1392 +int v3270_connect(GtkWidget *widget, const gchar *uri)
1384 1393 {
1385 1394 v3270 * terminal;
1386 1395 int rc = -1;
1387 1396  
1388   - trace("%s widget=%p host=%p",__FUNCTION__,widget,host);
  1397 + trace("%s widget=%p host=%p",__FUNCTION__,widget,uri);
1389 1398  
1390 1399 g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL);
1391 1400  
1392 1401 terminal = GTK_V3270(widget);
1393 1402  
1394   - rc = lib3270_connect(terminal->host,host,0);
  1403 +#ifdef DEBUG
  1404 + if(uri)
  1405 + {
  1406 + LIB3270_CONNECT_OPTION opt = LIB3270_CONNECT_OPTION_DEFAULTS;
  1407 + gchar * scheme = g_uri_unescape_string(uri,NULL);
  1408 + gchar * hostname = strchr(scheme,':');
  1409 + gchar * srvc;
  1410 + gchar * query;
  1411 +
  1412 + if(hostname)
  1413 + {
  1414 + *(hostname++) = 0;
  1415 +
  1416 + while(*hostname && !g_ascii_isalnum(*hostname))
  1417 + hostname++;
  1418 +
  1419 + if(*hostname)
  1420 + {
  1421 + if( ! (g_ascii_strcasecmp(scheme,"l") && g_ascii_strcasecmp(scheme,"ssl")) )
  1422 + opt |= LIB3270_CONNECT_OPTION_SSL;
  1423 +
  1424 + srvc = strchr(hostname,':');
  1425 + if(srvc)
  1426 + {
  1427 + *(srvc++) = 0;
  1428 + query = strchr(srvc,'?');
  1429 + if(query)
  1430 + *(query++) = 0;
  1431 + else
  1432 + query = "";
  1433 + }
  1434 + else
  1435 + {
  1436 + srvc = "telnet";
  1437 + }
  1438 +
  1439 + rc = lib3270_connect_host(terminal->host,hostname,srvc,opt);
  1440 +
  1441 + }
  1442 +
  1443 + }
  1444 +
  1445 +
  1446 + g_free(scheme);
  1447 +
  1448 + }
  1449 + else
  1450 + {
  1451 + rc = lib3270_connect(terminal->host,uri,0);
  1452 + }
  1453 +
  1454 +#else
  1455 + rc = lib3270_connect(terminal->host,uri,0);
  1456 +#endif // DEBUG
1395 1457  
1396 1458 trace("%s exits with rc=%d (%s)",__FUNCTION__,rc,strerror(rc));
1397 1459  
... ... @@ -1476,11 +1538,23 @@ gboolean v3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix)
1476 1538 return FALSE;
1477 1539 }
1478 1540  
1479   -void v3270_set_host(GtkWidget *widget, const gchar *uri)
  1541 +/**
  1542 + * v3270_set_host:
  1543 + *
  1544 + * @widget: V3270 widget.
  1545 + * @uri: a valid tn3270 URL.
  1546 + *
  1547 + * Set the default URL for the tn3270e host.
  1548 + *
  1549 + * Returns: The lib3270 processed string as an internal constant.
  1550 + *
  1551 + * Since: 5.0
  1552 + **/
  1553 +const gchar * v3270_set_host(GtkWidget *widget, const gchar *uri)
1480 1554 {
1481 1555 g_return_if_fail(GTK_IS_V3270(widget));
1482 1556 g_return_if_fail(uri != NULL);
1483   - lib3270_set_host(GTK_V3270(widget)->host,uri);
  1557 + return lib3270_set_host(GTK_V3270(widget)->host,uri);
1484 1558 }
1485 1559  
1486 1560 const gchar * v3270_get_host(GtkWidget *widget)
... ...
src/pw3270/window.c
... ... @@ -233,10 +233,10 @@
233 233 v3270_connect(GTK_PW3270(widget)->terminal,uri);
234 234 }
235 235  
236   - void pw3270_set_host(GtkWidget *widget, const gchar *uri)
  236 + const gchar * pw3270_set_host(GtkWidget *widget, const gchar *uri)
237 237 {
238 238 g_return_if_fail(GTK_IS_PW3270(widget));
239   - v3270_set_host(GTK_PW3270(widget)->terminal,uri);
  239 + return v3270_set_host(GTK_PW3270(widget)->terminal,uri);
240 240 }
241 241  
242 242 const gchar * pw3270_get_host(GtkWidget *widget)
... ...