Skip to content

Commit

Permalink
working on issue #509 #510
Browse files Browse the repository at this point in the history
  • Loading branch information
objeck committed Feb 8, 2025
1 parent 9debf9a commit 59b0815
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions core/compiler/lib_src/net_secure.obs
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,9 @@ if(client->Connect()) {
@socket : TCPSecureSocket;
@header : Byte[];
@url : Web.HTTP.Url;

@status_code : Int;
@status_msg : String;

# https client support
@request_headers : Hash<String, String>;
Expand Down Expand Up @@ -990,7 +992,7 @@ if(client->Connect()) {
if(@is_debug) {
"0: write - off={$i}, len={$chunk_size}"->PrintLine();
};
WriteFrame(data, i, chunk_size, 1, true);
WriteFrame(data, i, chunk_size, 0, true);

for(i := chunk_size; chunk_size + i < data_size; i += chunk_size) {
if(@is_debug) {
Expand Down Expand Up @@ -1052,7 +1054,7 @@ if(client->Connect()) {
"2: write - off={$i}, len={$rest}"->PrintLine();
};

WriteFrame(data, i, rest, 0, false);
WriteFrame(data, i, rest, 1, false);
};

return true;
Expand Down Expand Up @@ -1161,8 +1163,8 @@ if(client->Connect()) {
};

if(opcode = 0x88) {
@status_code := DecodeInt(@header, 0, 2);
buffer->ToString()->Trim()->PrintLine();
@status_code := DecodeInt(@header, 0, 2);
@status_msg := String->New(buffer, 2, buffer->Size() - 2);
@socket->Close();

return Nil;
Expand Down Expand Up @@ -1420,10 +1422,18 @@ buffer->ToString()->Trim()->PrintLine();
Gets the last status code
@return last status code
~#
method : public : GetLastStatus() ~ Int {
method : public : GetStatus() ~ Int {
return @status_code;
}

#~
Gets the last status message
@return last status message
~#
method : public : GetStatusMessage() ~ String {
return @status_msg;
}

#~
Gets the socket's X.509 certificate issuer name
@return certificate issuer name
Expand Down

0 comments on commit 59b0815

Please sign in to comment.