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 9, 2025
1 parent 4640be9 commit 595685f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
14 changes: 7 additions & 7 deletions core/compiler/lib_src/net_secure.obs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ if(client->Connect()) {
@cookies_enabled := cookies_enabled;
@cookies := Vector->New()<Cookie>;

# @is_debug := true;
@is_debug := true;
}

#~
Expand All @@ -856,7 +856,7 @@ if(client->Connect()) {

@response_headers := Hash->New()<String, String>;

# @is_debug := true;
@is_debug := true;
}

#~
Expand Down Expand Up @@ -1018,7 +1018,7 @@ if(client->Connect()) {
@return true if successful, false otherwise
~#
method : public : WriteSocket(message : String, fragment : Bool := false) ~ Bool {
chunk_size := 4096;
chunk_size := 5;

data := message->ToByteArray();
data_size := data->Size();
Expand Down Expand Up @@ -1163,7 +1163,7 @@ if(client->Connect()) {
};

if(@is_debug){
System.IO.Console->Print("read - buffer: '")->Print(String->New(buffer))->PrintLine("'\n===");
System.IO.Console->Print("read - buffer: '")->Print(buffer->ToHexString())->PrintLine("'\n===");
};

return buffer;
Expand Down Expand Up @@ -1305,13 +1305,13 @@ if(client->Connect()) {
if(@is_debug){
buffer := ByteBuffer->New();

"write - frame: "->Print();
each(f in frame) {
buffer->Append(f)
};
"\n==="->PrintLine();


"write - frame: "->Print();
buffer->ToByteArray()->ToHexString()->PrintLine();
"\n==="->PrintLine();
};

return @socket->WriteBuffer(frame) > 0;
Expand Down
Binary file modified docs/api.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion programs/tests/prgm331.obs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use Collection, Web.HTTP, System.IO.Filesystem;

class Test {
function : Main(args : String[]) ~ Nil {
text := FileReader->ReadFile("lorem-2.txt");
text := "Hello World, we in here!"; # FileReader->ReadFile("lorem-2.txt");
text_size := text->Size();
"text-size={$text_size}\n---"->PrintLine();

Expand Down
13 changes: 13 additions & 0 deletions programs/tests/prgm334.obs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Test {
function : Main(args : String[]) ~ Nil {
bytes := [0x81,0x18,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x2c,0x20,0x77,0x65,0x20,0x69,0x6e,0x20,0x68,0x65,0x72,0x65,0x21]->As(Byte[]);

bytes->Size()->PrintLine();
bytes->ToHexString()->PrintLine();
bytes[10]->PrintLine();
#~
b := Byte->New[[161,172,183]->As(Byte[])];
b->ToHexString()->PrintLine();
~#
}
}

0 comments on commit 595685f

Please sign in to comment.