Skip to content

Commit 5e738ae

Browse files
author
uib gmbh
committed
out commenting test function from code
1 parent ec62c7a commit 5e738ae

File tree

4 files changed

+4
-55
lines changed

4 files changed

+4
-55
lines changed

.DS_Store

-4 KB
Binary file not shown.

opsi-misc/opsiclientd-light-mac/opsihttpsacceptingthread.pas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ procedure TOpsiHTTPSAcceptingThread.ReadMessageBody;
148148
InputBody.SetSize(ContentLength);
149149
SizeReceived := AcceptorSocket.RecvBufferEx(InputBody.Memory, ContentLength, Timeout);
150150
InputBody.SetSize(SizeReceived);
151+
//AcceptorSocket.RecvStream(InputBody, TimeOut);
152+
//rpcMethod := AcceptorSocket.RecvString(TimeOut);
151153
end;
152-
CreateTestJSONRequestInputBody;
154+
//CreateTestJSONRequestInputBody;
153155
//InputBody.Clear;
154156
//InputBody.LoadFromStream(JSONStream);
155157
JSONRequest := TOpsiJSONRequest.Create(InputBody);
@@ -257,7 +259,7 @@ procedure TOpsiHTTPSAcceptingThread.WriteHeaders;
257259
if Protocol <> '' then
258260
begin
259261
Headers.Clear;
260-
Headers.Add('Content-type: text/html; charset=UTF-8');
262+
Headers.Add('Content-type: application/json; charset=UTF-8');
261263
Headers.Add('Content-length: ' + IntTostr(OutputBody.Size));
262264
Headers.Add('Connection: close');
263265
Headers.Add('Date: ' + Rfc822DateTime(now));

opsi-misc/opsiclientd-light-mac/opsijsonrequest.pas

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,22 @@ interface
1313

1414
TOpsiJSONRequest = class(TOpsiJSONrpcObject)
1515
private
16-
//function GetID: integer;
1716
function GetMethod:string;
1817
function GetParams: TJSONArray;
19-
//procedure SetID(aID: integer);
2018
procedure SetMethod(aMethod: string);
2119
procedure SetParams(theParams: TJSONArray);
2220
published
2321
property Method: string read GetMethod write SetMethod;
2422
property Params: TJSONArray read GetParams write SetParams;
25-
//property ID: integer read GetID write SetID;
2623
public
27-
//constructor Create(aStream: TStream);overload;
2824
constructor Create(aMethod: string; const theParams: array of const; aID: integer);overload;
29-
//procedure SaveToMemoryStream(aMemoryStream: TMemoryStream);
3025
end;
3126

3227

3328
implementation
3429

3530
{ TOpsiJSONRequest }
3631

37-
//procedure TOpsiJSONRequest.SetID(aID: integer);
38-
//begin
39-
// Add('id', aID);
40-
//end;
4132

4233
procedure TOpsiJSONRequest.SetMethod(aMethod: string);
4334
begin
@@ -49,11 +40,6 @@ procedure TOpsiJSONRequest.SetParams(theParams: TJSONArray);
4940
Add('params', theParams);
5041
end;
5142

52-
//constructor TOpsiJSONRequest.Create(aStream: TStream);
53-
//begin
54-
// //inherited Create;
55-
// self := TOpsiJSONRequest(GetJSON(aStream));
56-
//end;
5743

5844
constructor TOpsiJSONRequest.Create(aMethod: string;
5945
const theParams: array of const; aID: integer);
@@ -64,19 +50,6 @@ constructor TOpsiJSONRequest.Create(aMethod: string;
6450
ID := aID;
6551
end;
6652

67-
//procedure TOpsiJSONRequest.SaveToMemoryStream(aMemoryStream: TMemoryStream);
68-
//var
69-
// StringStream: TStringStream;
70-
//begin
71-
// StringStream := TStringStream.Create(self.AsJSON);
72-
// aMemoryStream.LoadFromStream(StringStream);
73-
// FreeAndNil(StringStream);
74-
//end;
75-
76-
//function TOpsiJSONRequest.GetID: integer;
77-
//begin
78-
// Result := Integers['id'];
79-
//end;
8053

8154
function TOpsiJSONRequest.GetMethod: string;
8255
begin

opsi-misc/opsiclientd-light-mac/opsijsonresponse.pas

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,14 @@ interface
1414
TOpsiJSONResponse = class(TOpsiJSONrpcObject)
1515
private
1616
function GetError: TJSONObject;
17-
//function GetID: integer;
1817
function GetResult: TJSONData;
1918
procedure SetError(aError: TJSONObject);
20-
//procedure SetID(aID: integer);
2119
procedure SetResult(aResult: TJSONData);
2220
published
2321
property Error: TJSONObject read GetError write SetError;
2422
property Result : TJSONData read GetResult write SetResult;
25-
//property ID: integer read GetID write SetID;
2623
public
27-
//constructor Create(aStream: TStream);overload;
2824
constructor Create(aResult: TJSONData; aError: TJSONObject; aID: integer); overload;
29-
//procedure SaveToMemoryStream(aMemoryStream: TMemoryStream);
3025
end;
3126

3227
implementation
@@ -39,10 +34,6 @@ function TOpsiJSONResponse.GetError: TJSONObject;
3934
Result := Objects['error'];
4035
end;
4136

42-
//function TOpsiJSONResponse.GetID: integer;
43-
//begin
44-
// Result := Integers['id'];
45-
//end;
4637

4738
function TOpsiJSONResponse.GetResult: TJSONData;
4839
begin
@@ -54,21 +45,12 @@ procedure TOpsiJSONResponse.SetError(aError: TJSONObject);
5445
Add('error', aError);
5546
end;
5647

57-
//procedure TOpsiJSONResponse.SetID(aID: integer);
58-
//begin
59-
// Add('id', aID);
60-
//end;
6148

6249
procedure TOpsiJSONResponse.SetResult(aResult: TJSONData);
6350
begin
6451
Add('result', aResult);
6552
end;
6653

67-
//constructor TOpsiJSONResponse.Create(aStream: TStream);
68-
//begin
69-
// //inherited Create;
70-
// self := TOpsiJSONResponse(GetJSON(aStream));
71-
//end;
7254

7355
constructor TOpsiJSONResponse.Create(aResult: TJSONData; aError: TJSONObject;
7456
aID: integer);
@@ -79,14 +61,6 @@ constructor TOpsiJSONResponse.Create(aResult: TJSONData; aError: TJSONObject;
7961
ID := aID;
8062
end;
8163

82-
//procedure TOpsiJSONResponse.SaveToMemoryStream(aMemoryStream: TMemoryStream);
83-
//var
84-
// StringStream: TStringStream;
85-
//begin
86-
// StringStream := TStringStream.Create(self.AsJSON);
87-
// aMemoryStream.LoadFromStream(StringStream);
88-
// FreeAndNil(StringStream);
89-
//end;
9064

9165
end.
9266

0 commit comments

Comments
 (0)