Skip to content

Commit

Permalink
Merge pull request #701 from zowe/httpserver-heap-config
Browse files Browse the repository at this point in the history
configure SLH size for ZSS to handle file size greater than 6mb
  • Loading branch information
JoeNemo authored Jun 5, 2024
2 parents 57d8d0f + 1d658cb commit 438a365
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to the ZSS package will be documented in this file.

## `2.17.0`
- Code to configure the SLH block size of the http server through 'httpRequestHeapMaxBlocks' in the yaml.(#701)

## `2.16.0`
- Bugfix: AUX should take leap seconds into account in their log messages' timestamp (#690, #691)

Expand Down
22 changes: 22 additions & 0 deletions c/zss.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,27 @@ static void setPrivilegedServerName(HttpServer *server, JsonObject *mvdSettings,
}
#endif /* __ZOWE_OS_ZOS */

static void setHttpRequestHeapMaxBlocks(HttpServer *server, ConfigManager *configmgr){

int maxBlocks = 0;
int getStatus = cfgGetIntC(configmgr,ZSS_CFGNAME,&maxBlocks,3,"components","zss","httpHeapMaxBlocks");

if (getStatus == ZCFG_SUCCESS){
if (maxBlocks > HTTP_REQUEST_HEAP_MAX_BLOCKS){
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "httpHeapMaxBlocks out of range, max value is %d\n",HTTP_REQUEST_HEAP_MAX_BLOCKS);
maxBlocks = HTTP_REQUEST_HEAP_MAX_BLOCKS;
} else if (maxBlocks < HTTP_REQUEST_HEAP_MIN_BLOCKS){
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "httpHeapMaxBlocks out of range, min value is %d\n",HTTP_REQUEST_HEAP_MIN_BLOCKS);
maxBlocks = HTTP_REQUEST_HEAP_MIN_BLOCKS;
}
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "httpHeapMaxBlocks should be between %d and %d\n",HTTP_REQUEST_HEAP_MIN_BLOCKS,HTTP_REQUEST_HEAP_MAX_BLOCKS);
} else{
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "fallback to default server settings\n");
maxBlocks = HTTP_REQUEST_HEAP_DEFAULT_BLOCKS;
}
server->config->httpRequestHeapMaxBlocks = (unsigned int)maxBlocks;
}

static void loadWebServerConfigV2(HttpServer *server,
ConfigManager *configmgr,
hashtable *htUsers,
Expand All @@ -370,6 +391,7 @@ static void loadWebServerConfigV2(HttpServer *server,
server->config->userTimeouts = htUsers;
server->config->groupTimeouts = htGroups;
server->config->defaultTimeout = defaultSessionTimeout;
setHttpRequestHeapMaxBlocks(server, configmgr);
registerHttpServiceOfLastResort(server,NULL);
#ifdef __ZOWE_OS_ZOS
setPrivilegedServerNameV2(server, configmgr);
Expand Down
2 changes: 1 addition & 1 deletion deps/zowe-common-c

0 comments on commit 438a365

Please sign in to comment.