Commit 5c12e21e9935ad031d244d93f310d06292ccb45b
1 parent
b094d22b
Exists in
master
and in
5 other branches
Ajuste na API
Showing
2 changed files
with
19 additions
and
49 deletions
Show diff stats
src/lib3270/connect.c
| @@ -251,7 +251,6 @@ static void net_connected(H3270 *hSession) | @@ -251,7 +251,6 @@ static void net_connected(H3270 *hSession) | ||
| 251 | 251 | ||
| 252 | snprintf(hSession->full_model_name,LIB3270_FULL_MODEL_NAME_LENGTH,"IBM-327%c-%d",hSession->m3279 ? '9' : '8', hSession->model_num); | 252 | snprintf(hSession->full_model_name,LIB3270_FULL_MODEL_NAME_LENGTH,"IBM-327%c-%d",hSession->m3279 ? '9' : '8', hSession->model_num); |
| 253 | 253 | ||
| 254 | - | ||
| 255 | hSession->ever_3270 = False; | 254 | hSession->ever_3270 = False; |
| 256 | 255 | ||
| 257 | memset(&hints, 0, sizeof(struct addrinfo)); | 256 | memset(&hints, 0, sizeof(struct addrinfo)); |
| @@ -263,7 +262,6 @@ static void net_connected(H3270 *hSession) | @@ -263,7 +262,6 @@ static void net_connected(H3270 *hSession) | ||
| 263 | hints.ai_addr = NULL; | 262 | hints.ai_addr = NULL; |
| 264 | hints.ai_next = NULL; | 263 | hints.ai_next = NULL; |
| 265 | 264 | ||
| 266 | - | ||
| 267 | hSession->cstate = LIB3270_RESOLVING; | 265 | hSession->cstate = LIB3270_RESOLVING; |
| 268 | lib3270_st_changed(hSession, LIB3270_STATE_RESOLVING, True); | 266 | lib3270_st_changed(hSession, LIB3270_STATE_RESOLVING, True); |
| 269 | 267 | ||
| @@ -276,29 +274,29 @@ static void net_connected(H3270 *hSession) | @@ -276,29 +274,29 @@ static void net_connected(H3270 *hSession) | ||
| 276 | snprintf(buffer,4095,_( "Can't connect to %s:%s"), hSession->host.current, hSession->host.srvc); | 274 | snprintf(buffer,4095,_( "Can't connect to %s:%s"), hSession->host.current, hSession->host.srvc); |
| 277 | 275 | ||
| 278 | #if defined(WIN32) && defined(HAVE_ICONV) | 276 | #if defined(WIN32) && defined(HAVE_ICONV) |
| 279 | - { | ||
| 280 | - char tmpbuffer[4096]; | ||
| 281 | - const char * msg = gai_strerror(s); | ||
| 282 | - size_t in = strlen(msg); | ||
| 283 | - size_t out = 4096; | ||
| 284 | - char * ptr = tmpbuffer; | 277 | + { |
| 278 | + char tmpbuffer[4096]; | ||
| 279 | + const char * msg = gai_strerror(s); | ||
| 280 | + size_t in = strlen(msg); | ||
| 281 | + size_t out = 4096; | ||
| 282 | + char * ptr = tmpbuffer; | ||
| 285 | 283 | ||
| 286 | - iconv_t hConv = iconv_open(lib3270_win32_local_charset(),"UTF-8"); | 284 | + iconv_t hConv = iconv_open(lib3270_win32_local_charset(),"UTF-8"); |
| 287 | 285 | ||
| 288 | - trace("Antes: [%s]",msg); | ||
| 289 | - if(iconv(hConv,&msg,&in,&ptr,&out) != ((size_t) -1)) | ||
| 290 | - msg = tmpbuffer; | ||
| 291 | - trace("Depois: [%s]",msg); | 286 | + trace("Antes: [%s]",msg); |
| 287 | + if(iconv(hConv,&msg,&in,&ptr,&out) != ((size_t) -1)) | ||
| 288 | + msg = tmpbuffer; | ||
| 289 | + trace("Depois: [%s]",msg); | ||
| 292 | 290 | ||
| 293 | - iconv_close(hConv); | 291 | + iconv_close(hConv); |
| 294 | 292 | ||
| 295 | - lib3270_popup_dialog( hSession, | ||
| 296 | - LIB3270_NOTIFY_ERROR, | ||
| 297 | - _( "Connection error" ), | ||
| 298 | - buffer, | ||
| 299 | - "%s", | ||
| 300 | - msg); | ||
| 301 | - } | 293 | + lib3270_popup_dialog( hSession, |
| 294 | + LIB3270_NOTIFY_ERROR, | ||
| 295 | + _( "Connection error" ), | ||
| 296 | + buffer, | ||
| 297 | + "%s", | ||
| 298 | + msg); | ||
| 299 | + } | ||
| 302 | 300 | ||
| 303 | #else | 301 | #else |
| 304 | lib3270_popup_dialog( hSession, | 302 | lib3270_popup_dialog( hSession, |
src/lib3270/host.c
| @@ -362,34 +362,6 @@ LIB3270_EXPORT const char * lib3270_get_host(H3270 *h) | @@ -362,34 +362,6 @@ LIB3270_EXPORT const char * lib3270_get_host(H3270 *h) | ||
| 362 | return h->host.full; | 362 | return h->host.full; |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | -/* | ||
| 366 | -LIB3270_EXPORT int lib3270_reconnect(H3270 *hSession,int wait) | ||
| 367 | -{ | ||
| 368 | - int rc; | ||
| 369 | - | ||
| 370 | - CHECK_SESSION_HANDLE(hSession); | ||
| 371 | - | ||
| 372 | - if (CONNECTED || HALF_CONNECTED) | ||
| 373 | - return EBUSY; | ||
| 374 | - | ||
| 375 | - if (!hSession->host.full) | ||
| 376 | - return EINVAL; | ||
| 377 | - | ||
| 378 | - if (hSession->auto_reconnect_inprogress) | ||
| 379 | - return EBUSY; | ||
| 380 | - | ||
| 381 | - rc = lib3270_connect(hSession,wait); | ||
| 382 | - | ||
| 383 | - if(rc) | ||
| 384 | - { | ||
| 385 | - hSession->auto_reconnect_inprogress = 0; | ||
| 386 | - return rc; | ||
| 387 | - } | ||
| 388 | - | ||
| 389 | - return 0; | ||
| 390 | -} | ||
| 391 | -*/ | ||
| 392 | - | ||
| 393 | LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h) | 365 | LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h) |
| 394 | { | 366 | { |
| 395 | CHECK_SESSION_HANDLE(h); | 367 | CHECK_SESSION_HANDLE(h); |