Skip to content

Commit

Permalink
are you fucking kidding me
Browse files Browse the repository at this point in the history
  • Loading branch information
Snirozu committed Jul 8, 2024
1 parent 3795b38 commit b472c0b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions source/online/Downloader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ class Downloader {
socket.write('GET ${urlFormat.path} HTTP/1.1${headers}\n\n');

var httpStatus:String = null;
socket.waitForRead();
httpStatus = socket.input.readLine();
httpStatus = httpStatus.substr(httpStatus.indexOf(" ")).ltrim();

Expand Down Expand Up @@ -176,7 +175,6 @@ class Downloader {

var gotHeaders:Map<String, String> = new Map<String, String>();
while (!cancelRequested) {
socket.waitForRead();
var readLine:String = socket.input.readLine();
if (readLine.trim() == "") {
break;
Expand Down Expand Up @@ -248,7 +246,6 @@ class Downloader {
isDownloading = true;
while (gotContent < contentLength && !cancelRequested) {
try {
socket.waitForRead();
_bytesWritten = socket.input.readBytes(buffer, 0, buffer.length);
file.writeBytes(buffer, 0, _bytesWritten);
gotContent += _bytesWritten;
Expand Down
4 changes: 0 additions & 4 deletions source/online/HTTPClient.hx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class HTTPClient {
socket.write('${request.post ? "POST" : "GET"} ${request.path} HTTP/1.1${header}\r\n\r\n${request.body != null ? request.body : ""}');

//read response status
socket.waitForRead();
var status:Array<String> = socket.input.readLine().split(" ");
status.shift();
response.status = Std.parseInt(status.shift());
Expand All @@ -64,7 +63,6 @@ class HTTPClient {
//read response headers
response.headers = new Map<String, String>();
while (true) {
socket.waitForRead();
var readLine:String = socket.input.readLine();
if (readLine.trim() == "")
break;
Expand All @@ -88,7 +86,6 @@ class HTTPClient {
if (request.bodyOutput != null)
while (receivedContent < bodySize) {
try {
socket.waitForRead();
_bytesWritten = socket.input.readBytes(buffer, 0, buffer.length);
request.bodyOutput.writeBytes(buffer, 0, _bytesWritten);
receivedContent += _bytesWritten;
Expand All @@ -107,7 +104,6 @@ class HTTPClient {
response.body = "";
while (receivedContent < bodySize) {
try {
socket.waitForRead();
_bytesWritten = socket.input.readBytes(buffer, 0, buffer.length);
response.body += buffer.getString(0, _bytesWritten);
receivedContent += _bytesWritten;
Expand Down

0 comments on commit b472c0b

Please sign in to comment.