Skip to content

Commit

Permalink
Zowe Suite v2.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Jul 2, 2024
2 parents 72ed1e0 + 7c0d765 commit 88b0742
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Zowe Common C Changelog

## `2.17.0`
- Fixed `xplatform.loadFileUTF8` when trying to open nonexistent file (#454)
- Bugfix: fix an incorrect check in the recovery router code which might lead to
the state cell-pool being released prematurely (#446)
- Allocating SLH for http server with configurable value 'httpRequestHeapMaxBlocks' in yaml (#447).

## `2.16.0`
- No yaml value converted to null (#442)
- Added `zos.getZosVersion()` and `zos.getEsm()` calls for configmgr QJS (#429)
Expand Down
2 changes: 1 addition & 1 deletion build/configmgr.proj.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROJECT="configmgr"
VERSION=2.16.0
VERSION=2.17.0
DEPS="QUICKJS LIBYAML"

QUICKJS="quickjs"
Expand Down
2 changes: 1 addition & 1 deletion build/getesm.proj.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROJECT="getesm"
VERSION=2.16.0
VERSION=2.17.0
DEPS=""
7 changes: 3 additions & 4 deletions c/embeddedjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename);
/* (filename, ccsid) ccsid -1 implies guess best for platform, 0 implies don't translate */
static JSValue xplatformLoadFileUTF8(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv){
size_t size;
size_t length;
char *buf;

Expand All @@ -626,7 +625,9 @@ static JSValue xplatformLoadFileUTF8(JSContext *ctx, JSValueConst this_val,
JS_ToInt32(ctx, &sourceCCSID, argv[1]);

buf = (char*)js_load_file(ctx, &length, filename);

if (!buf) {
return JS_EXCEPTION;
}
if (sourceCCSID < 0){
char *nativeBuffer = safeMalloc(length+1,"xplatformStringFromBytes");
memcpy(nativeBuffer,buf,length);
Expand Down Expand Up @@ -678,7 +679,6 @@ static int appendToFile(char *filename, const char *data, int length) {
/* (filename, ccsid) ccsid -1 implies guess best for platform, 0 implies don't translate */
static JSValue xplatformAppendFileUTF8(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv){
size_t size;
size_t length;

NATIVE_STR(filename,nativeFilename,0);
Expand Down Expand Up @@ -718,7 +718,6 @@ static JSValue xplatformAppendFileUTF8(JSContext *ctx, JSValueConst this_val,
/* (filename, ccsid) ccsid -1 implies guess best for platform, 0 implies don't translate */
static JSValue xplatformStoreFileUTF8(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv){
size_t size;
size_t length;

NATIVE_STR(filename,nativeFilename,0);
Expand Down
7 changes: 6 additions & 1 deletion c/httpserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,7 @@ HttpServer *makeHttpServerInner(STCBase *base,
memcpy(&server->config->sessionTokenKey[0], &sessionTokenKey,
sizeof (sessionTokenKey));
server->config->authTokenType = SERVICE_AUTH_TOKEN_TYPE_LEGACY;
server->config->httpRequestHeapMaxBlocks = HTTP_REQUEST_HEAP_DEFAULT_BLOCKS;

return server;
}
Expand Down Expand Up @@ -1656,6 +1657,8 @@ static HttpServer *makeSecureHttpServerInner(STCBase *base, int port,
int64 now = getFineGrainedTime();
server->config->sessionTokenKeySize = sizeof (now);
memcpy(&server->config->sessionTokenKey[0], &now, sizeof (now));
server->config->httpRequestHeapMaxBlocks = HTTP_REQUEST_HEAP_DEFAULT_BLOCKS;

return server;
}
#endif
Expand Down Expand Up @@ -5821,7 +5824,9 @@ static int httpHandleTCP(STCBase *base,
}
}
#endif // USE_ZOWE_TLS
ShortLivedHeap *slh = makeShortLivedHeap(READ_BUFFER_SIZE,100);
HttpServer *server = (HttpServer*) module->data;
unsigned int maxBlocks = server->config->httpRequestHeapMaxBlocks;
ShortLivedHeap *slh = makeShortLivedHeap(READ_BUFFER_SIZE, maxBlocks);
#ifndef __ZOWE_OS_WINDOWS
int writeBufferSize = 0x40000;
setSocketWriteBufferSize(peerSocket,0x40000, &returnCode, &reasonCode);
Expand Down
6 changes: 5 additions & 1 deletion c/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,14 +497,16 @@ static void * __ptr32 getRecoveryRouterAddress() {
" LA 1,RCVXINF LOAD ROUTER SERVICE INFO \n"
" BRAS 14,RCVSIFLB RECORD IT, REMOVE CONTEXT, PERCOLATE \n"
" TM RCXFLAG1,R@CF1USP USER STATE POOL? \n"
" BZ RCVFRL04 NO, DO NOT FREE IT \n"
" BNZ RCVFRL04 NO, DO NOT FREE IT \n"
" LT 2,RCXSCPID CELL POOL ZERO? \n"
" BZ RCVFRL04 YES, DO NOT FREE IT \n"
#ifdef _LP64
" SAM31 \n"
" SYSSTATE AMODE64=NO \n"
#endif
" CPOOL DELETE,CPID=(2) FREE THE STATE CELL POOL \n"
" LGFI 2,X'7FFFFBA3' MAKE AN OBVIOUSLY BAD ADDRESS \n"
" ST 2,RCXSCPID MARK THE CPID FOR DEBUGGING PURPOSES \n"
#ifdef _LP64
" SAM64 \n"
" SYSSTATE AMODE64=YES \n"
Expand Down Expand Up @@ -1291,6 +1293,8 @@ RecoveryStatePool *recoveryMakeStatePool(unsigned int stateCount) {

void recoveryRemoveStatePool(RecoveryStatePool *statePool) {
removeRecoveryStatePool(statePool->cellPool);
// put a bad address for debugging (in case the statePool storage survives)
statePool->cellPool = 0x7FFFFBA1;
storageRelease(statePool, sizeof(RecoveryStatePool));
}

Expand Down
5 changes: 5 additions & 0 deletions h/httpserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@

#define HTTP_SERVER_PRIVILEGED_SERVER_PROPERTY "zisServerName"

#define HTTP_REQUEST_HEAP_DEFAULT_BLOCKS 1024
#define HTTP_REQUEST_HEAP_MIN_BLOCKS 100
#define HTTP_REQUEST_HEAP_MAX_BLOCKS 4096

typedef struct BigBuffer_tag{
ShortLivedHeap *slh; /* can be null */
char *data;
Expand Down Expand Up @@ -220,6 +224,7 @@ typedef struct HTTPServerConfig_tag {
hashtable *userTimeouts;
hashtable *groupTimeouts;
int defaultTimeout;
unsigned int httpRequestHeapMaxBlocks;
/* The config manager is optional, but zss and other servers need
a near-global way to get configuration data.
*/
Expand Down
2 changes: 1 addition & 1 deletion manifest.template.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: zowe-common-c

version: 2.16.0
version: 2.17.0

homepage: https://zowe.org
keywords:
Expand Down

0 comments on commit 88b0742

Please sign in to comment.