Commit 48e894104c0adca137b0c9152c00d19114b75bfe
1 parent
be75b9f6
Exists in
master
and in
3 other branches
Trabalhando no SSL
Showing
1 changed file
with
32 additions
and
20 deletions
Show diff stats
telnet.c
@@ -37,29 +37,40 @@ | @@ -37,29 +37,40 @@ | ||
37 | * the given IBM host. | 37 | * the given IBM host. |
38 | */ | 38 | */ |
39 | 39 | ||
40 | +#include <lib3270/config.h> | ||
41 | +#if defined(HAVE_LIBSSL) | ||
42 | + #include <openssl/ssl.h> | ||
43 | + #include <openssl/err.h> | ||
44 | +#endif | ||
45 | + | ||
40 | #include "globals.h" | 46 | #include "globals.h" |
41 | #include <errno.h> | 47 | #include <errno.h> |
42 | 48 | ||
43 | -#if defined(_WIN32) /*[*/ | ||
44 | -#include <winsock2.h> | ||
45 | -#include <ws2tcpip.h> | ||
46 | -#else /*][*/ | ||
47 | -#include <sys/socket.h> | ||
48 | -#include <sys/ioctl.h> | ||
49 | -#include <netinet/in.h> | ||
50 | -#endif /*]*/ | 49 | +#if defined(_WIN32) |
50 | + #include <winsock2.h> | ||
51 | + #include <ws2tcpip.h> | ||
52 | +#else | ||
53 | + #include <sys/socket.h> | ||
54 | + #include <sys/ioctl.h> | ||
55 | + #include <netinet/in.h> | ||
56 | +#endif | ||
57 | + | ||
51 | #define TELCMDS 1 | 58 | #define TELCMDS 1 |
52 | #define TELOPTS 1 | 59 | #define TELOPTS 1 |
53 | #include "arpa_telnet.h" | 60 | #include "arpa_telnet.h" |
54 | -#if !defined(_WIN32) /*[*/ | ||
55 | -#include <arpa/inet.h> | ||
56 | -#endif /*]*/ | 61 | + |
62 | +#if !defined(_WIN32) | ||
63 | + #include <arpa/inet.h> | ||
64 | +#endif | ||
65 | + | ||
57 | #include <errno.h> | 66 | #include <errno.h> |
58 | #include <fcntl.h> | 67 | #include <fcntl.h> |
59 | -#if !defined(_WIN32) /*[*/ | ||
60 | -#include <netdb.h> | ||
61 | -#endif /*]*/ | ||
62 | -#include <stdarg.h> | 68 | + |
69 | +#if !defined(_WIN32) | ||
70 | + #include <netdb.h> | ||
71 | +#endif | ||
72 | + | ||
73 | +// #include <stdarg.h> | ||
63 | 74 | ||
64 | #include "tn3270e.h" | 75 | #include "tn3270e.h" |
65 | #include "3270ds.h" | 76 | #include "3270ds.h" |
@@ -2593,11 +2604,12 @@ check_linemode(Boolean init) | @@ -2593,11 +2604,12 @@ check_linemode(Boolean init) | ||
2593 | */ | 2604 | */ |
2594 | linemode = !hisopts[TELOPT_ECHO] /* && !hisopts[TELOPT_SGA] */; | 2605 | linemode = !hisopts[TELOPT_ECHO] /* && !hisopts[TELOPT_SGA] */; |
2595 | 2606 | ||
2596 | - if (init || linemode != wasline) { | 2607 | + if (init || linemode != wasline) |
2608 | + { | ||
2597 | st_changed(ST_LINE_MODE, linemode); | 2609 | st_changed(ST_LINE_MODE, linemode); |
2598 | - if (!init) { | ||
2599 | - trace_dsn("Operating in %s mode.\n", | ||
2600 | - linemode ? "line" : "character-at-a-time"); | 2610 | + if (!init) |
2611 | + { | ||
2612 | + trace_dsn("Operating in %s mode.\n",linemode ? "line" : "character-at-a-time"); | ||
2601 | } | 2613 | } |
2602 | #if defined(X3270_ANSI) /*[*/ | 2614 | #if defined(X3270_ANSI) /*[*/ |
2603 | if (IN_ANSI && linemode) | 2615 | if (IN_ANSI && linemode) |
@@ -3375,7 +3387,7 @@ static void ssl_info_callback(INFO_CONST SSL *s, int where, int ret) | @@ -3375,7 +3387,7 @@ static void ssl_info_callback(INFO_CONST SSL *s, int where, int ret) | ||
3375 | lib3270_write_log(NULL,"SSL","Current state is \"%s\"",SSL_state_string_long(s)); | 3387 | lib3270_write_log(NULL,"SSL","Current state is \"%s\"",SSL_state_string_long(s)); |
3376 | } | 3388 | } |
3377 | 3389 | ||
3378 | - trace("%s: where=%04x ret=%d",__FUNCTION__,where,ret); | 3390 | + trace("%s: state=%04x where=%04x ret=%d",__FUNCTION__,SSL_state(s),where,ret); |
3379 | 3391 | ||
3380 | #ifdef DEBUG | 3392 | #ifdef DEBUG |
3381 | if(where & SSL_CB_EXIT) | 3393 | if(where & SSL_CB_EXIT) |