Commit 1294de607270eb9bacf4e38771d21765f7fb516c

Authored by Perry Werneck
1 parent 82810a20

Ajustes em função de teste com valgrind.

src/lib3270/ctlr.c
... ... @@ -142,9 +142,8 @@ void ctlr_reinit(H3270 *session, unsigned cmask)
142 142 session->buffer[1] = tmp = lib3270_calloc(sizeof(struct lib3270_ea),sz+1,session->buffer[1]);
143 143 session->aea_buf = tmp + 1;
144 144  
145   - session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text);
146   -
147   - Replace(session->zero_buf, (unsigned char *)Calloc(sizeof(struct lib3270_ea),sz));
  145 + session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text);
  146 + session->zero_buf = lib3270_calloc(sizeof(struct lib3270_ea),sz,session->zero_buf);
148 147  
149 148 session->cursor_addr = 0;
150 149 session->buffer_addr = 0;
... ... @@ -247,23 +246,6 @@ const char * lib3270_get_model(H3270 *hSession)
247 246 return hSession->model_name;
248 247 }
249 248  
250   -/**
251   - * Deal with the relationships between model numbers and rows/cols.
252   - *
253   - * @param hSession Session handle.
254   - * @param model New model (updates model name)
255   - */ /*
256   -int lib3270_set_model(H3270 *hSession, int model)
257   -{
258   - if(CONNECTED)
259   - return EBUSY;
260   -
261   - ctlr_set_rows_cols(hSession,model,hSession->ov_cols,hSession->ov_rows);
262   - ctlr_reinit(hSession,MODEL_CHANGE);
263   - screen_update(hSession,0,hSession->rows*hSession->cols);
264   - return 0;
265   -} */
266   -
267 249 int lib3270_set_model(H3270 *hSession, const char *model)
268 250 {
269 251 int ovc, ovr;
... ...
src/lib3270/screenc.h
... ... @@ -39,10 +39,6 @@
39 39 #define display_height() 1
40 40 #define display_widthMM() 100
41 41 #define display_width() 1
42   -// #define screen_obscured() False
43   -// #define screen_scroll() screen_disp()
44   -// #define screen_132() /* */
45   -// #define screen_80() /* */
46 42  
47 43 LIB3270_INTERNAL int screen_init(H3270 *session);
48 44 // LIB3270_INTERNAL Boolean screen_new_display_charsets(char *cslist, char *csname);
... ...
src/lib3270/ssl.c
... ... @@ -95,19 +95,22 @@ int ssl_negotiate(H3270 *hSession)
95 95  
96 96 if (rv != 1)
97 97 {
98   - int ssl_error = SSL_get_error(hSession->ssl_con,rv);
  98 + int ssl_error = SSL_get_error(hSession->ssl_con,rv);
  99 + const char * msg = "";
99 100  
100 101 if(ssl_error == SSL_ERROR_SYSCALL && hSession->ssl_error)
101 102 ssl_error = hSession->ssl_error;
102 103  
103   - trace_dsn(hSession,"SSL_connect failed: %s %s\n",ERR_lib_error_string(hSession->ssl_error),ERR_reason_error_string(hSession->ssl_error));
  104 + msg = ERR_lib_error_string(ssl_error);
  105 +
  106 + trace_dsn(hSession,"SSL_connect failed: %s %s\n",msg,ERR_reason_error_string(hSession->ssl_error));
104 107  
105 108 lib3270_popup_dialog(
106 109 hSession,
107 110 LIB3270_NOTIFY_ERROR,
108 111 N_( "Security error" ),
109 112 N_( "SSL Connect failed" ),
110   - "%s",ERR_lib_error_string(ssl_error)
  113 + "%s",msg ? msg : ""
111 114 );
112 115  
113 116 lib3270_disconnect(hSession);
... ...
src/lib3270/telnet.c
... ... @@ -996,6 +996,8 @@ void net_input(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno)
996 996  
997 997 CHECK_SESSION_HANDLE(hSession);
998 998  
  999 + memset(buffer,0,BUFSZ);
  1000 +
999 1001 #if defined(_WIN32)
1000 1002 for (;;)
1001 1003 #endif
... ...
src/lib3270/valgrind.suppression
... ... @@ -0,0 +1,14 @@
  1 +{
  2 + addch
  3 + Memcheck:Cond
  4 + fun:addch
  5 + fun:screen_update
  6 + fun:screen_disp
  7 + fun:status_reset
  8 + fun:defer_unlock
  9 + fun:lib3270_default_event_dispatcher
  10 + fun:lib3270_main_iterate
  11 + fun:mainloop
  12 + fun:main
  13 +}
  14 +
... ...