Commit 856f6f8f932a5f3df9cdb59ee23902ac56bf54b4

Authored by Perry Werneck
1 parent 3c622f36

Fixing bug in the "wait-for-connect" process.

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
src/core/linux/connect.c
@@ -32,6 +32,7 @@ @@ -32,6 +32,7 @@
32 #include <errno.h> 32 #include <errno.h>
33 #include <lib3270/trace.h> 33 #include <lib3270/trace.h>
34 #include <lib3270/toggle.h> 34 #include <lib3270/toggle.h>
  35 +#include "kybdc.h"
35 36
36 #include <sys/types.h> 37 #include <sys/types.h>
37 #include <sys/socket.h> 38 #include <sys/socket.h>
@@ -282,13 +283,16 @@ static void net_connected(H3270 *hSession, int GNUC_UNUSED(fd), LIB3270_IO_FLAG @@ -282,13 +283,16 @@ static void net_connected(H3270 *hSession, int GNUC_UNUSED(fd), LIB3270_IO_FLAG
282 case LIB3270_CONNECTED_INITIAL_E: 283 case LIB3270_CONNECTED_INITIAL_E:
283 case LIB3270_CONNECTED_NVT: 284 case LIB3270_CONNECTED_NVT:
284 case LIB3270_CONNECTED_SSCP: 285 case LIB3270_CONNECTED_SSCP:
  286 + case LIB3270_RESOLVING:
285 break; 287 break;
286 288
287 case LIB3270_NOT_CONNECTED: 289 case LIB3270_NOT_CONNECTED:
288 return errno = ENOTCONN; 290 return errno = ENOTCONN;
289 291
290 case LIB3270_CONNECTED_TN3270E: 292 case LIB3270_CONNECTED_TN3270E:
291 - return 0; 293 + if(!hSession->starting)
  294 + return 0;
  295 + break;
292 296
293 default: 297 default:
294 lib3270_write_log(hSession,"connect", "%s: State changed to unexpected state %d",__FUNCTION__,hSession->cstate); 298 lib3270_write_log(hSession,"connect", "%s: State changed to unexpected state %d",__FUNCTION__,hSession->cstate);