Skip to content

Commit

Permalink
Enable file transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
gotzmann committed Jun 10, 2021
1 parent 9ed1c36 commit 2085431
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Comet.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function run()
// This helps optimize regular API calls execution speed

try {
/* EXP:ME
/////* EXP:ME
// TODO Refactor web-server as standalone component
// TODO Distinguish relative and absolute directories
// TODO HTTP Cache, MIME Types, Multiple Domains, Check Extensions
Expand Down Expand Up @@ -341,11 +341,14 @@ public function run()
return self::sendFile($connection, $filename);
}
}
*/
/////*/
// Proceed with other handlers
$response = self::_handle($request);
$connection->send($response);

// EXP Try to send file AFTER the handlers


} catch(HttpNotFoundException $error) {
$connection->send(new WorkermanResponse(404));
} catch(\Throwable $error) {
Expand Down Expand Up @@ -392,7 +395,7 @@ public static function sendFile($connection, $file_name)
{
// TODO Enable trunk transfer for BIG files
// TODO Dig into 304 status processing
echo "\n[DBG] SendFile"; // DEBUG
//echo "\n[DBG] SendFile"; // DEBUG
$items = file(self::$mimeFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if (!is_array($items)) {
echo "\n[ERR] Failed to get [mime.type] file content";
Expand Down

0 comments on commit 2085431

Please sign in to comment.