Skip to content

Commit

Permalink
Assmble Path & Parameters
Browse files Browse the repository at this point in the history
onPacket Path & params
Param & Path Max Size fixes
  • Loading branch information
Universal Web committed Aug 16, 2023
1 parent 441f81a commit 898969b
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 109 deletions.
14 changes: 7 additions & 7 deletions udsp/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class UDSP {
maxDataSize,
maxHeadSize,
maxPathSize,
maxParamsSize
maxParametersSize
} = this;
if (maxPayloadSize) {
if (!maxDataSize) {
Expand All @@ -20,8 +20,8 @@ export class UDSP {
if (!maxHeadSize) {
this.maxHeadSize = maxPayloadSize;
}
if (!maxParamsSize) {
this.maxParamsSize = maxPayloadSize;
if (!maxParametersSize) {
this.maxParametersSize = maxPayloadSize;
}
if (!maxPathSize) {
this.maxPathSize = maxPayloadSize;
Expand All @@ -39,11 +39,11 @@ export class UDSP {
if (!maxHeadSize) {
this.maxHeadSize = this.maxPayloadSize - this.emptyPayloadOverHeadSize;
}
if (!maxParamsSize) {
this.maxParamsSize = this.maxPayloadSize - this.emptyPayloadOverParamsSize;
if (!maxParametersSize) {
this.maxParametersSize = this.maxPayloadSize - this.emptyPayloadOverHeadSize;
}
if (!maxPathSize) {
this.maxPathSize = this.maxPayloadSize - this.emptyPayloadOverPathSize;
this.maxPathSize = this.maxPayloadSize - this.emptyPayloadOverHeadSize;
}
console.log(`packetInitialOverhead: ${packetInitialOverhead} bytes`);
}
Expand All @@ -55,7 +55,7 @@ export class UDSP {
console.log(`Max Data Size: ${this.maxDataSize} bytes`);
console.log(`Max Head Size: ${this.maxHeadSize} bytes`);
console.log(`Max Path Size: ${this.maxPathSize} bytes`);
console.log(`Max Paraneters Size: ${this.maxParamsSize} bytes`);
console.log(`Max Paraneters Size: ${this.maxParametersSize} bytes`);
console.log(`Max Packet Size: ${this.maxPacketSize} bytes`);
}
generateConnectionID() {
Expand Down
2 changes: 1 addition & 1 deletion udsp/cryptography.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Cryptography {
console.log('cryptographyConfig.encryptKeypair', cryptographyConfig.encryptKeypair);
if (!config.encryptKeypair) {
console.log('keypairType', config.keypairType);
console.log('exchange', exchange);
console.log('Keypair exchange', exchange);
if (config.keypairType === 'ed25519' && exchange === 'x25519') {
if (config.privateKey) {
this.encryptionKeypair = signKeypairToEncryptKeypair({
Expand Down
8 changes: 4 additions & 4 deletions udsp/request/ask.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { Base } from './base.js';
import { request } from '#udsp/requestTypes/request';
export class Ask extends Base {
constructor(method = 'get', path, params, data, head, options = {}, source) {
constructor(method = 'get', path, parameters, data, head, options = {}, source) {
super(options, source);
const {
requestQueue,
Expand All @@ -26,9 +26,9 @@ export class Ask extends Base {
this.path = path;
this.pathSize = path.length;
}
if (params) {
this.request.params = params;
this.params = params;
if (parameters) {
this.request.parameters = parameters;
this.parameters = parameters;
}
if (data) {
this.request.data = data;
Expand Down
Loading

0 comments on commit 898969b

Please sign in to comment.