diff --git a/CHANGELOG.md b/CHANGELOG.md index 224e2bbec..a0fe357cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,5 @@ # Zowe Common C Changelog -## `2.19.0` -- Adding more arguments to httpClientSessionInit to allow passing back rc (#467). - ## `2.18.1` - Bugfix: IARV64 results must be checked for 0x7FFFF000 (#474) - Bugfix: SLH should not ABEND when MEMLIMIT is reached (additional NULL check) diff --git a/c/httpclient.c b/c/httpclient.c index 172154897..3d2c40f3c 100644 --- a/c/httpclient.c +++ b/c/httpclient.c @@ -647,14 +647,12 @@ void httpClientSessionDestroy(HttpClientSession *session) { /** * After this call, an stcbase'd caller should 'register' the socket */ -int httpClientSessionInit2(HttpClientContext *ctx, HttpClientSession **outSession, int *rc) { +int httpClientSessionInit(HttpClientContext *ctx, HttpClientSession **outSession) { int sts = 0; - int bpxrsn = 0; - int *bpxrc = rc; + int bpxrc = 0, bpxrsn = 0; HttpClientSession *session = NULL; ShortLivedHeap *slh = NULL; - *bpxrc = 0; do { if ((NULL == ctx) || (NULL == outSession)) { @@ -662,13 +660,13 @@ int httpClientSessionInit2(HttpClientContext *ctx, HttpClientSession **outSessio break; } - Socket *socket = tcpClient2(ctx->serverAddress, 1000 * ctx->recvTimeoutSeconds, bpxrc, &bpxrsn); - if ((*bpxrc != 0) || (NULL == socket)) { + Socket *socket = tcpClient2(ctx->serverAddress, 1000 * ctx->recvTimeoutSeconds, &bpxrc, &bpxrsn); + if ((bpxrc != 0) || (NULL == socket)) { #ifdef __ZOWE_OS_ZOS - HTTP_CLIENT_TRACE_VERBOSE("%s (rc=%d, rsn=0x%x, addr=0x%08x, port=%d)\n", HTTP_CLIENT_MSG_CONNECT_FAILED, *bpxrc, + HTTP_CLIENT_TRACE_VERBOSE("%s (rc=%d, rsn=0x%x, addr=0x%08x, port=%d)\n", HTTP_CLIENT_MSG_CONNECT_FAILED, bpxrc, bpxrsn, ctx->serverAddress->v4Address, ctx->serverAddress->port); #else - HTTP_CLIENT_TRACE_VERBOSE("%s (rc=%d, rsn=0x%x, addr=0x%08x, port=%d)\n", HTTP_CLIENT_MSG_CONNECT_FAILED, *bpxrc, + HTTP_CLIENT_TRACE_VERBOSE("%s (rc=%d, rsn=0x%x, addr=0x%08x, port=%d)\n", HTTP_CLIENT_MSG_CONNECT_FAILED, bpxrc, bpxrsn, ctx->serverAddress->internalAddress.v4Address, ctx->serverAddress->port); #endif sts = HTTP_CLIENT_CONNECT_FAILED; @@ -686,7 +684,7 @@ int httpClientSessionInit2(HttpClientContext *ctx, HttpClientSession **outSessio int rc = tlsSocketInit(ctx->tlsEnvironment, &socket->tlsSocket, socket->sd, false); if (rc != 0) { HTTP_CLIENT_TRACE_VERBOSE("failed to init tls socket, rc=%d, (%s)", rc, tlsStrError(rc)); - socketClose(socket, bpxrc, &bpxrsn); + socketClose(socket, &bpxrc, &bpxrsn); sts = HTTP_CLIENT_TLS_ERROR; break; } diff --git a/c/qjsnet.c b/c/qjsnet.c index 3235801be..ac2fcfbc0 100644 --- a/c/qjsnet.c +++ b/c/qjsnet.c @@ -189,7 +189,6 @@ static int httpGet(bool isTLS, int status = 0; char buffer[2048]; LoggingContext *loggingContext = getLoggingContext(); - int rc = 0; do{ clientSettings.host = host; @@ -217,7 +216,7 @@ static int httpGet(bool isTLS, if (httpTrace){ printf("successfully initialized http client\n"); } - status = httpClientSessionInit2(httpClientContext, &session, &rc); + status = httpClientSessionInit(httpClientContext, &session); if (status){ if (httpTrace){ printf("error initing session: %d\n", status); diff --git a/h/httpclient.h b/h/httpclient.h index 79ead6409..937caa261 100644 --- a/h/httpclient.h +++ b/h/httpclient.h @@ -121,7 +121,7 @@ int httpClientContextInitSecure(HttpClientSettings *settings, void httpClientSessionDestroy(HttpClientSession *session); -int httpClientSessionInit2(HttpClientContext *ctx, HttpClientSession **outSession, int *rc); +int httpClientSessionInit(HttpClientContext *ctx, HttpClientSession **outSession); int httpClientSessionStageRequest(HttpClientContext *ctx, HttpClientSession *session,