Commit 3af8230be2efa9780b51ecb1ca514dd511d0c8dc
1 parent
3ffe424a
Exists in
master
and in
3 other branches
Incluindo opção para incluir o nome da LU na URL de conexão
Showing
2 changed files
with
34 additions
and
1 deletions
Show diff stats
host.c
| @@ -573,6 +573,39 @@ LIB3270_EXPORT const char * lib3270_set_url(H3270 *h, const char *n) | @@ -573,6 +573,39 @@ LIB3270_EXPORT const char * lib3270_set_url(H3270 *h, const char *n) | ||
| 573 | Replace(h->host.current,strdup(hostname)); | 573 | Replace(h->host.current,strdup(hostname)); |
| 574 | Replace(h->host.srvc,strdup(srvc)); | 574 | Replace(h->host.srvc,strdup(srvc)); |
| 575 | 575 | ||
| 576 | + // Verifica parâmetros | ||
| 577 | + if(query && *query) | ||
| 578 | + { | ||
| 579 | + char *str = strdup(query); | ||
| 580 | + char *saveptr = NULL; | ||
| 581 | + char *ptr; | ||
| 582 | + | ||
| 583 | + for(ptr = strtok_r(str,"&",&saveptr);ptr;ptr=strtok_r(NULL,"&",&saveptr)) | ||
| 584 | + { | ||
| 585 | + char *var = ptr; | ||
| 586 | + char *val = strchr(ptr,'='); | ||
| 587 | + if(val) | ||
| 588 | + { | ||
| 589 | + *(val++) = 0; | ||
| 590 | + | ||
| 591 | + if(!(strcasecmp(var,"lu") && strcasecmp(var,"luname"))) | ||
| 592 | + { | ||
| 593 | + strncpy(h->luname,val,LIB3270_LUNAME_LENGTH); | ||
| 594 | + } | ||
| 595 | + else | ||
| 596 | + { | ||
| 597 | + lib3270_write_log(h,"","Ignoring invalid URL attribute \"%s\"",var); | ||
| 598 | + } | ||
| 599 | + | ||
| 600 | + | ||
| 601 | + } | ||
| 602 | + | ||
| 603 | + } | ||
| 604 | + | ||
| 605 | + free(str); | ||
| 606 | + } | ||
| 607 | + | ||
| 608 | + // Notifica atualização | ||
| 576 | update_host(h); | 609 | update_host(h); |
| 577 | 610 | ||
| 578 | free(str); | 611 | free(str); |
telnet.c
| @@ -1441,7 +1441,7 @@ static int telnet_fsm(H3270 *hSession, unsigned char c) | @@ -1441,7 +1441,7 @@ static int telnet_fsm(H3270 *hSession, unsigned char c) | ||
| 1441 | if (hSession->lus != (char **)NULL && hSession->try_lu == CN) | 1441 | if (hSession->lus != (char **)NULL && hSession->try_lu == CN) |
| 1442 | { | 1442 | { |
| 1443 | /* None of the LUs worked. */ | 1443 | /* None of the LUs worked. */ |
| 1444 | - popup_an_error(NULL,"Cannot connect to specified LU"); | 1444 | + popup_an_error(hSession, _( "Cannot connect to specified LU" ) ); |
| 1445 | return -1; | 1445 | return -1; |
| 1446 | } | 1446 | } |
| 1447 | 1447 |