-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix #3362 (#3365) * Fix #3368 (#3369) * fix #3367 * Fix typo Co-authored-by: twosee <twose@qq.com> * Fix swoole_get_local_mac on OSX (#3372) # Conflicts: # swoole.cc * fix mysql test case (#3374) * fix: stop worker in workerStart (#3382) * fix: stop worker in workerStart * improvement: add newline at end of file * Fix missing MySQL transaction error, update the test (#3429) * fix http client download filename bug (#3489) * fix http client download filename bug * fix zend::String()->release() * Fix #3532 (#3534) * fix #3532 * improve getHeaderOut() * add tests # Conflicts: # include/coroutine_socket.h # swoole_http_client_coro.cc * Fixed: fix header inject when use CRLF (#3539) * fix: fix header inject when use CRLF * test: add test # Conflicts: # swoole_http_response.cc * Fixed: Fix CRLF injection in `redirect` and `header` (#3541) * Fix CRLF injection in `redirect` and `header` The previous fix (#3539) was incomplete. The added check is not enforced when `ucwords` is set to false. * Fix typo # Conflicts: # swoole_http_response.cc * Fixed: check cookie injection (#3545) * Fixed: check cookie injection * fix: don't check crlf when use cookie urlencode # Conflicts: # swoole_http_response.cc * Fixed: set coroutine websocket server frame->fd (#3549) * Fixed: set coroutine websocket server frame->fd * fix: fix test * Fix #3577 (#3579) # Conflicts: # swoole_runtime.cc * Fix the test (#3430) # Conflicts: # tests/swoole_http2_client_coro/post.phpt * test: fix swoole_http_client_coro/upload_big.phpt (#3590) * fix: fix http client upload_big test * fix: http client upload big file * Fix test * Fix free * Fix free Co-authored-by: twosee <twose@qq.com> Co-authored-by: 韩天峰-Rango <mikan.tenny@gmail.com> Co-authored-by: 耐小心 <qiqizjl@qq.com> Co-authored-by: codinghuang <2812240764@qq.com> Co-authored-by: Jiantao Li <CurseRed@Gmail.com>
- Loading branch information
1 parent
3190f71
commit 0c3b7e4
Showing
27 changed files
with
486 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,7 @@ class string | |
if (str) | ||
{ | ||
zend_string_release(str); | ||
str = nullptr; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--TEST-- | ||
swoole_http_client_coro: The bug of the filename parameter of download() | ||
--SKIPIF-- | ||
<?php | ||
require __DIR__ . '/../include/skipif.inc'; | ||
?> | ||
--FILE-- | ||
<?php | ||
require __DIR__ . '/../include/bootstrap.php'; | ||
class C1 | ||
{ | ||
protected $f; | ||
|
||
protected $savedFileName; | ||
|
||
public function __construct($f) | ||
{ | ||
$this->f = $f; | ||
} | ||
|
||
public function withSavedFileName($savedFileName) | ||
{ | ||
$self = clone $this; | ||
$self->savedFileName = $savedFileName; | ||
return $self; | ||
} | ||
|
||
public function getSavedFileName() | ||
{ | ||
return $this->savedFileName; | ||
} | ||
|
||
} | ||
|
||
function download($pm, $fileName) | ||
{ | ||
$basename = substr($fileName, 0, -2); | ||
$fileName = $basename . '.jpg'; | ||
$c1 = new C1($fileName); | ||
$c1 = $c1->withSavedFileName($fileName); | ||
|
||
$client = new \Swoole\Coroutine\Http\Client('127.0.0.1', $pm->getFreePort()); | ||
$client->set(['timeout' => 5]); | ||
|
||
$client->download('/', $fileName); | ||
} | ||
|
||
$pm = new SwooleTest\ProcessManager; | ||
$pm->parentFunc = function () use ($pm) { | ||
Co\run(function () use($pm) { | ||
download($pm, '/tmp/test-1.*'); | ||
}); | ||
|
||
Co\run(function () use($pm) { | ||
download($pm, '/tmp/test-2.*'); | ||
}); | ||
|
||
$pm->kill(); | ||
}; | ||
$pm->childFunc = function () use ($pm) { | ||
$serv = new swoole_http_server('127.0.0.1', $pm->getFreePort(), SERVER_MODE_RANDOM); | ||
$serv->set(['log_file' => '/dev/null']); | ||
$serv->on('workerStart', function () use ($pm) { | ||
$pm->wakeup(); | ||
}); | ||
$serv->on('request', function (swoole_http_request $request, swoole_http_response $response) { | ||
$response->sendfile(TEST_IMAGE); | ||
}); | ||
$serv->start(); | ||
}; | ||
$pm->childFirst(); | ||
$pm->run(); | ||
?> | ||
--EXPECT-- |
Oops, something went wrong.