@serve.zone/dcrouter 18.8.5 → 18.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -726,6 +726,18 @@ export class OpsViewRemoteIngress extends DeesElement {
726
726
  .description=${'Milliseconds to wait for initial client data before connecting upstream. Leave empty for default.'}
727
727
  .value=${performance.firstDataConnectTimeoutMs?.toString() || ''}
728
728
  ></dees-input-text>
729
+ <dees-input-text
730
+ .key=${'maxHalfClosedStreams'}
731
+ .label=${'Max Retained Half-closed Streams'}
732
+ .description=${'Streams kept after the backend sent FIN while the client upload is still open. 0 disables backend-initiated retention. Leave empty for the profile default.'}
733
+ .value=${performance.maxHalfClosedStreams?.toString() || ''}
734
+ ></dees-input-text>
735
+ <dees-input-text
736
+ .key=${'halfCloseDrainTimeoutMs'}
737
+ .label=${'Half-close Drain Timeout'}
738
+ .description=${'Milliseconds allowed for draining a half-closed stream before it is reset. Leave empty for default.'}
739
+ .value=${performance.halfCloseDrainTimeoutMs?.toString() || ''}
740
+ ></dees-input-text>
729
741
  <dees-input-text
730
742
  .key=${'serverFirstPorts'}
731
743
  .label=${'Server-first Ports'}
@@ -797,6 +809,8 @@ export class OpsViewRemoteIngress extends DeesElement {
797
809
  this.assignOptionalPositiveIntegerSetting(next, 'maxStreamsPerEdge', formData.maxStreamsPerEdge, 'Max Connections / Edge');
798
810
  this.assignOptionalPositiveIntegerSetting(next, 'clientWriteTimeoutMs', formData.clientWriteTimeoutMs, 'Client Write Timeout');
799
811
  this.assignOptionalPositiveIntegerSetting(next, 'firstDataConnectTimeoutMs', formData.firstDataConnectTimeoutMs, 'First Data Timeout');
812
+ this.assignOptionalPositiveIntegerSetting(next, 'maxHalfClosedStreams', formData.maxHalfClosedStreams, 'Max Retained Half-closed Streams', 0);
813
+ this.assignOptionalPositiveIntegerSetting(next, 'halfCloseDrainTimeoutMs', formData.halfCloseDrainTimeoutMs, 'Half-close Drain Timeout');
800
814
 
801
815
  const serverFirstPortsText = `${formData.serverFirstPorts || ''}`.trim();
802
816
  if (serverFirstPortsText) {
@@ -814,18 +828,19 @@ export class OpsViewRemoteIngress extends DeesElement {
814
828
 
815
829
  private assignOptionalPositiveIntegerSetting(
816
830
  target: interfaces.data.IRemoteIngressPerformanceConfig,
817
- key: 'maxStreamsPerEdge' | 'clientWriteTimeoutMs' | 'firstDataConnectTimeoutMs',
831
+ key: 'maxStreamsPerEdge' | 'clientWriteTimeoutMs' | 'firstDataConnectTimeoutMs' | 'maxHalfClosedStreams' | 'halfCloseDrainTimeoutMs',
818
832
  value: any,
819
833
  label: string,
834
+ minValue: 0 | 1 = 1,
820
835
  ): void {
821
- const text = `${value || ''}`.trim();
836
+ const text = `${value ?? ''}`.trim();
822
837
  if (!text) {
823
838
  delete target[key];
824
839
  return;
825
840
  }
826
841
  const parsed = Number.parseInt(text, 10);
827
- if (!Number.isInteger(parsed) || parsed < 1) {
828
- throw new Error(`${label} must be a positive integer`);
842
+ if (!Number.isInteger(parsed) || parsed < minValue) {
843
+ throw new Error(`${label} must be a ${minValue === 0 ? 'non-negative' : 'positive'} integer`);
829
844
  }
830
845
  target[key] = parsed;
831
846
  }
@@ -310,6 +310,8 @@ export class OpsViewConfig extends DeesElement {
310
310
  { key: 'Max Connections / Edge', value: ri.performance.maxStreamsPerEdge ?? null },
311
311
  { key: 'Client Write Timeout', value: ri.performance.clientWriteTimeoutMs ? `${ri.performance.clientWriteTimeoutMs} ms` : null },
312
312
  { key: 'First Data Timeout', value: ri.performance.firstDataConnectTimeoutMs ? `${ri.performance.firstDataConnectTimeoutMs} ms` : null },
313
+ { key: 'Max Retained Half-closed Streams', value: ri.performance.maxHalfClosedStreams ?? null },
314
+ { key: 'Half-close Drain Timeout', value: ri.performance.halfCloseDrainTimeoutMs ? `${ri.performance.halfCloseDrainTimeoutMs} ms` : null },
313
315
  { key: 'Server-first Ports', value: ri.performance.serverFirstPorts?.length ? ri.performance.serverFirstPorts.map(String) : null, type: 'pills' },
314
316
  );
315
317
  }