Commit 3b6d0324c7bf4f6685c6f0ddf22e249a50c5101a
1 parent
8d37354a
Exists in
master
and in
5 other branches
Implementando dialogo de popup, corrigindo teste da libssl e incluindo popup qua…
…ndo não está disponível
Showing
5 changed files
with
34 additions
and
19 deletions
Show diff stats
configure.ac
@@ -188,10 +188,10 @@ AC_SUBST(GTK_CFLAGS) | @@ -188,10 +188,10 @@ AC_SUBST(GTK_CFLAGS) | ||
188 | 188 | ||
189 | #--[ SSL ]---------------------------------------------------------------------------------------------------------------------------------------------------- | 189 | #--[ SSL ]---------------------------------------------------------------------------------------------------------------------------------------------------- |
190 | 190 | ||
191 | -PKG_CHECK_MODULES( [SSL], [libssl], AC_DEFINE(HAVE_SSL), AC_MSG_NOTICE([libssl not present.]) ) | 191 | +PKG_CHECK_MODULES( [LIBSSL], [libssl], AC_DEFINE(HAVE_LIBSSL), AC_MSG_NOTICE([libssl not present.]) ) |
192 | 192 | ||
193 | -AC_SUBST(SSL_LIBS) | ||
194 | -AC_SUBST(SSL_CFLAGS) | 193 | +AC_SUBST(LIBSSL_LIBS) |
194 | +AC_SUBST(LIBSSL_CFLAGS) | ||
195 | 195 | ||
196 | #--[ Libraries ]---------------------------------------------------------------------------------------------------------------------------------------------- | 196 | #--[ Libraries ]---------------------------------------------------------------------------------------------------------------------------------------------- |
197 | AC_SEARCH_LIBS( [sin], [m], AC_DEFINE(HAVE_LIBM), AC_MSG_NOTICE([libm not present.])) | 197 | AC_SEARCH_LIBS( [sin], [m], AC_DEFINE(HAVE_LIBM), AC_MSG_NOTICE([libm not present.])) |
src/gtk/main.c
@@ -70,7 +70,6 @@ static int popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title, | @@ -70,7 +70,6 @@ static int popup_handler(H3270 *session, LIB3270_NOTIFY type, const char *title, | ||
70 | gtk_dialog_run(GTK_DIALOG (dialog)); | 70 | gtk_dialog_run(GTK_DIALOG (dialog)); |
71 | gtk_widget_destroy(dialog); | 71 | gtk_widget_destroy(dialog); |
72 | 72 | ||
73 | - | ||
74 | return 0; | 73 | return 0; |
75 | } | 74 | } |
76 | 75 |
src/lib3270/Makefile.in
@@ -29,15 +29,15 @@ | @@ -29,15 +29,15 @@ | ||
29 | PACKAGE=@PACKAGE_NAME@ | 29 | PACKAGE=@PACKAGE_NAME@ |
30 | 30 | ||
31 | CFLAGS=@CFLAGS@ -DAPPDATA=\"$(datarootdir)/$(PACKAGE_NAME)\" -I../../src/include | 31 | CFLAGS=@CFLAGS@ -DAPPDATA=\"$(datarootdir)/$(PACKAGE_NAME)\" -I../../src/include |
32 | -SSL_CFLAGS=@SSL_CFLAGS@ | 32 | +SSL_CFLAGS=@LIBSSL_CFLAGS@ |
33 | 33 | ||
34 | DLL_FLAGS=@DLL_FLAGS@ | 34 | DLL_FLAGS=@DLL_FLAGS@ |
35 | LDFLAGS=@LDFLAGS@ | 35 | LDFLAGS=@LDFLAGS@ |
36 | 36 | ||
37 | -LIBS=@LIBS@ @SSL_LIBS@ @SOCKET_LIBS@ | 37 | +LIBS=@LIBS@ @LIBSSL_LIBS@ @SOCKET_LIBS@ |
38 | 38 | ||
39 | DEBUG_CFLAGS=-DDEBUG=1 -g | 39 | DEBUG_CFLAGS=-DDEBUG=1 -g |
40 | -DEPENDS ?= *.h ../../src/include/*.h | 40 | +DEPENDS ?= *.h ../../src/include/*.h Makefile |
41 | 41 | ||
42 | #---[ Tools ]------------------------------------------------------------------ | 42 | #---[ Tools ]------------------------------------------------------------------ |
43 | 43 | ||
@@ -79,7 +79,7 @@ SOURCES = XtGlue.c actions.c ansi.c charset.c ctlr.c \ | @@ -79,7 +79,7 @@ SOURCES = XtGlue.c actions.c ansi.c charset.c ctlr.c \ | ||
79 | #---[ Misc targets ]----------------------------------------------------------- | 79 | #---[ Misc targets ]----------------------------------------------------------- |
80 | 80 | ||
81 | Debug: $(BINDBG)/@DLLPREFIX@3270@DLLEXT@ | 81 | Debug: $(BINDBG)/@DLLPREFIX@3270@DLLEXT@ |
82 | - | 82 | + |
83 | 83 | ||
84 | $(BINDBG)/@DLLPREFIX@3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) | 84 | $(BINDBG)/@DLLPREFIX@3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) |
85 | @echo $@ ... | 85 | @echo $@ ... |
src/lib3270/host.c
@@ -258,8 +258,10 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru, | @@ -258,8 +258,10 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru, | ||
258 | /* Strip leading whitespace. */ | 258 | /* Strip leading whitespace. */ |
259 | while (*s && isspace(*s)) | 259 | while (*s && isspace(*s)) |
260 | s++; | 260 | s++; |
261 | - if (!*s) { | ||
262 | - popup_an_error(NULL,_( "Empty hostname" )); | 261 | + |
262 | + if (!*s) | ||
263 | + { | ||
264 | + popup_an_error(hSession,_( "Empty hostname" )); | ||
263 | goto split_fail; | 265 | goto split_fail; |
264 | } | 266 | } |
265 | 267 | ||
@@ -286,18 +288,32 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru, | @@ -286,18 +288,32 @@ split_host(H3270 *hSession, char *s, char *ansi, char *std_ds, char *passthru, | ||
286 | case 'N': | 288 | case 'N': |
287 | *non_e = True; | 289 | *non_e = True; |
288 | break; | 290 | break; |
289 | -#if defined(HAVE_LIBSSL) /*[*/ | 291 | +#if defined(HAVE_LIBSSL) |
290 | case 'l': | 292 | case 'l': |
291 | case 'L': | 293 | case 'L': |
292 | *secure = True; | 294 | *secure = True; |
293 | break; | 295 | break; |
294 | -#endif /*]*/ | 296 | +#else |
297 | + case 'l': | ||
298 | + case 'L': | ||
299 | + popup_system_error(hSession, _( "SSL error" ), | ||
300 | + _( "Unable to connect to secure hosts" ), | ||
301 | + "%s", | ||
302 | + _( "This version of " PACKAGE_NAME " was built without support for secure sockets layer (SSL)." ) | ||
303 | + ); | ||
304 | + | ||
305 | + goto split_fail; | ||
306 | +#endif // HAVE_LIBSSL | ||
295 | case 'c': | 307 | case 'c': |
296 | case 'C': | 308 | case 'C': |
297 | *no_login = True; | 309 | *no_login = True; |
298 | break; | 310 | break; |
299 | default: | 311 | default: |
300 | - popup_system_error(hSession,NULL,_("Hostname syntax error"),_("Option '%c:' not supported"),*s); | 312 | + popup_system_error(hSession, _( "Hostname syntax error" ), |
313 | + _( "Can't connect to host" ), | ||
314 | + _( "Option '%c:' is not supported" ), | ||
315 | + *s ); | ||
316 | + | ||
301 | goto split_fail; | 317 | goto split_fail; |
302 | } | 318 | } |
303 | *needed = True; | 319 | *needed = True; |
src/lib3270/telnet.c
@@ -1009,7 +1009,7 @@ void net_input(H3270 *session) | @@ -1009,7 +1009,7 @@ void net_input(H3270 *session) | ||
1009 | trace_dsn("RCVD SSL_read error %ld (%s)\n", e, | 1009 | trace_dsn("RCVD SSL_read error %ld (%s)\n", e, |
1010 | err_buf); | 1010 | err_buf); |
1011 | 1011 | ||
1012 | - popup_an_error("SSL_read:\n%s", err_buf); | 1012 | + popup_an_error(NULL,"SSL_read:\n%s", err_buf); |
1013 | host_disconnect(session,True); | 1013 | host_disconnect(session,True); |
1014 | return; | 1014 | return; |
1015 | } | 1015 | } |
@@ -2019,7 +2019,7 @@ net_rawout(unsigned const char *buf, int len) | @@ -2019,7 +2019,7 @@ net_rawout(unsigned const char *buf, int len) | ||
2019 | e = ERR_get_error(); | 2019 | e = ERR_get_error(); |
2020 | (void) ERR_error_string(e, err_buf); | 2020 | (void) ERR_error_string(e, err_buf); |
2021 | trace_dsn("RCVD SSL_write error %ld (%s)\n", e,err_buf); | 2021 | trace_dsn("RCVD SSL_write error %ld (%s)\n", e,err_buf); |
2022 | - popup_an_error("SSL_write:\n%s", err_buf); | 2022 | + popup_an_error(NULL,"SSL_write:\n%s", err_buf); |
2023 | host_disconnect(&h3270,False); | 2023 | host_disconnect(&h3270,False); |
2024 | return; | 2024 | return; |
2025 | } | 2025 | } |
@@ -3216,7 +3216,7 @@ ssl_init(void) | @@ -3216,7 +3216,7 @@ ssl_init(void) | ||
3216 | ssl_initted = True; | 3216 | ssl_initted = True; |
3217 | ssl_ctx = SSL_CTX_new(SSLv23_method()); | 3217 | ssl_ctx = SSL_CTX_new(SSLv23_method()); |
3218 | if (ssl_ctx == NULL) { | 3218 | if (ssl_ctx == NULL) { |
3219 | - popup_an_error("SSL_CTX_new failed"); | 3219 | + popup_an_error(NULL,"SSL_CTX_new failed"); |
3220 | h3270.ssl_host = False; | 3220 | h3270.ssl_host = False; |
3221 | return; | 3221 | return; |
3222 | } | 3222 | } |
@@ -3225,7 +3225,7 @@ ssl_init(void) | @@ -3225,7 +3225,7 @@ ssl_init(void) | ||
3225 | 3225 | ||
3226 | ssl_con = SSL_new(ssl_ctx); | 3226 | ssl_con = SSL_new(ssl_ctx); |
3227 | if (ssl_con == NULL) { | 3227 | if (ssl_con == NULL) { |
3228 | - popup_an_error("SSL_new failed"); | 3228 | + popup_an_error(NULL,"SSL_new failed"); |
3229 | h3270.ssl_host = False; | 3229 | h3270.ssl_host = False; |
3230 | } | 3230 | } |
3231 | SSL_set_verify(ssl_con, 0/*xxx*/, NULL); | 3231 | SSL_set_verify(ssl_con, 0/*xxx*/, NULL); |
@@ -3243,7 +3243,7 @@ ssl_init(void) | @@ -3243,7 +3243,7 @@ ssl_init(void) | ||
3243 | e = ERR_get_error(); | 3243 | e = ERR_get_error(); |
3244 | (void) ERR_error_string(e, err_buf); | 3244 | (void) ERR_error_string(e, err_buf); |
3245 | 3245 | ||
3246 | - popup_an_error("SSL_CTX_use_certificate_chain_file(" | 3246 | + popup_an_error(NULL,"SSL_CTX_use_certificate_chain_file(" |
3247 | "\"%s\") failed:\n%s", | 3247 | "\"%s\") failed:\n%s", |
3248 | appres.cert_file, err_buf); | 3248 | appres.cert_file, err_buf); |
3249 | } | 3249 | } |
@@ -3338,7 +3338,7 @@ continue_tls(unsigned char *sbbuf, int len) | @@ -3338,7 +3338,7 @@ continue_tls(unsigned char *sbbuf, int len) | ||
3338 | if (len < 2 || sbbuf[1] != TLS_FOLLOWS) { | 3338 | if (len < 2 || sbbuf[1] != TLS_FOLLOWS) { |
3339 | /* Trace the junk. */ | 3339 | /* Trace the junk. */ |
3340 | trace_dsn("%s ? %s\n", opt(TELOPT_STARTTLS), cmd(SE)); | 3340 | trace_dsn("%s ? %s\n", opt(TELOPT_STARTTLS), cmd(SE)); |
3341 | - popup_an_error("TLS negotiation failure"); | 3341 | + popup_an_error(NULL,"TLS negotiation failure"); |
3342 | net_disconnect(); | 3342 | net_disconnect(); |
3343 | return; | 3343 | return; |
3344 | } | 3344 | } |