Swow Versions Save

Coroutine-based cross-platform concurrent I/O engine.

v0.2.0-alpha.1

1 year ago

TL;DR

一波API重构:

  • Buffer类取消内置偏移,这解决了许多问题
  • 重构HttpParser->execute(): 现在它返回的是parsed长度而非事件了

一些新功能:

  • 完整的PSR支持
  • IpAddress类:简单的ip地址parser和一些实用api
  • 一些dns解析函数的hook

Major API refactor:

  • Removed internal offset in Buffer class, this solves many bugs
  • Refactor HttpParser->execute(): now it returns parsed length rather than events

Something New:

  • Full PSR compatibility
  • IpAddress class: simple IP address parser and some utility APIs
  • some hook for dns lookup functions

开发进展记录

修复

  • 修复detectShouldKeepAlive()检查 (#132)
  • 修复了许多静态分析警告
  • 修复上传文件不完整
  • 例行优化代码
  • 修复了一些库API参数类型
  • 修复了一些情况下URI_TOO_LARGE/HEADER_FIELDS_TOO_LARGE报错

增加 删除 修改

  • 库测试覆盖率支持(#131)
  • 添加http parser方法Http\Parser->getPreviousEvent() Http\Parser->getPreviousEventName() `Http\Parser::getEventNameFor(int $event)
  • WebSocket::mask()WebSocket::unmask() 工具函数
  • 移除 Socket->sendString(), 现在可以用Socket->send()
  • 移除 WebSocket\Frame, Websocket现在使用WebSocket\Header类加自己的payload
  • 重构HttpParser->execute(): 现在它返回的是parsed长度而非事件了
  • 一些API重命名:Errno:: getNameFor(int) => getNameOf(int) getReasonPhraseFor(int) => getReasonPhraseOf(int) getDescriptionFor(int) => getDescriptionOf(int)

Fix

  • Fixed detectShouldKeepAlive() check (#132)
  • Fixed many static analyzers warnings
  • Fixed uncompleted uploadedFile data
  • Optimize codes as usual
  • Fixed some APIs arguments in library
  • Fix URI_TOO_LARGE/HEADER_FIELDS_TOO_LARGE at some situation

Addition Removal Change

  • Library tests coverage (#131)
  • Add new http parser methods Http\Parser->getPreviousEvent() Http\Parser->getPreviousEventName() Http\Parser::getEventNameFor(int $event)
  • WebSocket::mask() and WebSocket::unmask() utility
  • Removed Socket->sendString(), use Socket->send() instead
  • Removed WebSocket\Frame, use WebSocket\Header class with payload instead
  • Refactor HttpParser->execute(): now it returns parsed length rather than events
  • Some API rename Errno:: getNameFor(int) => getNameOf(int) getReasonPhraseFor(int) => getReasonPhraseOf(int) getDescriptionFor(int) => getDescriptionOf(int)

Hashes and notes

*.pdb是调试符号,仅使用Swow不需要下载 *.pdb is debug symbols, not necessary for using Swow

File name Size (in bytes) SHA256 sum Build log Tests result
php_swow-php8.0-x64-nts-VS16.dll 1167360 86194F331835652C1F93DEF9537C8FB28231FF43180F1171224D7D495DB582D0 - failure
php_swow-php8.0-x64-ts-VS16.dll 1192448 A2DDEA6550CFDF8BB5A9031C8B36571B3C92995A641F943EF7B6D894B77394C6 - failure
php_swow-php8.1-x64-nts-VS16.dll 1166336 CEA39A0A86F68EA44894386473472A22E961D1A2CFCDEFE7318F390EC02A1DC9 - failure
php_swow-php8.1-x64-ts-VS16.dll 1193472 BC2608F4EE42960B2356ACC5B16A294D18841DC7D87EF83E47839473EA57DB1D - failure

v0.1.0-nightly20220722

1 year ago

TL;DR

主要变化:

  • Closure的序列化支持
  • hook了proc_open
  • 修了一些个bug

Major changes:

  • Added Closure serialization support
  • Added proc_open hook
  • Fixed many bugs

修复

  • 修复 Typed property Swow\Http\ServerRequest::$parsedBody must not be accessed before initialization(#104)
  • 修复协程退出后defer执行不正确 (#112)
  • 修复ZTS构建中的一些问题
  • 更新cURL相关的一些行为(修复一些assertion问题)
  • 修复未开启openssl使用Swow的段错误
  • 修复 Coroutine::getCurrent, Coroutine::getMain Coroutine::getPrevious Buffer->copy 函数签名
  • 修复 Socket->sendTo Socket->writeTo Socket->sendStringTo 参数类型声明
  • 修复 Coroutine->setLocalVar() 中的内存错误
  • 修复调试函数中栈帧跳过的一些问题
  • 修复Coroutine::getExecutedFunctionName()方法
  • 修复setUri(UriInterface $uri, ?bool $preserveHost = null): static方法签名
  • 修复"Cannot unpack array with string keys"报错
  • 修复某些情况下HTTP parser死循环

增加 删除 修改

  • 支持序列化Closure对象
  • 添加对proc_open的hook
  • 实现serverParams和cookieParams来支持PSR风格的$_SERVER获取机制
  • HTTP parser支持multipart文件上传(Http\Parser->isMultipart(): bool 方法 Http\UploadFile Http\RawUploadFilearray Http\RawResult->$uploadedFiles 属性等)
  • HTTP parser支持chunked编码(Http\Parser->isChunked():bool Http\Parser->getCurrentChunkLength(): int 方法等)
  • 添加文档注释和注解供静态分析器使用
  • 新增 Coroutine::registerDeadlockHandler(callable $callable): Util\Handler API
  • 新增 Socket->getSimpleType(): int Socket->getSimpleTypeName(): string Socket::typeSimplify(int $type): int Socket::typeName(int $type): string Socket->getId(): int API
  • 新增 Http\Server\Connection->recvHttpRequestTo(Request $request): Request Http\WebSocketTrait->recvWebSocketFrameTo(WebSocketFrame $frame): WebSocketFrame API
  • 新增 Http\MimeType Stream\Psr7Stream
  • 完善socket选项的支持
  • 添加Http\Message->detectContentLength(): int API
  • 添加Object\DupTrait 特质
  • 添加Http\Uri::from(UriInterface|string $uri): static API
  • 添加Coroutine->isExecuting(): bool API
  • 移除Http\Server\Connection->setServer(),修改Http\Server\Connection构造符为__construct(Server $server)
  • 移除Http\Message->getBodyAsString()
  • 移除Buffer->copy()
  • 优化代码 (#109)
  • 移动errno常量到 Errno 类中
  • 移动命名空间常量到 Swow 类中
  • 重命名 Yyyy\Xxxx\Exception -> Yyyy\XxxxException (#108)
  • $capacity = -1 现在表示不限制channel的容量
  • 更改php stream的bind,accept和connect错误返回值为原始系统错误码
  • 拆分Socket->accept()Socket->accept(?int $timeout = null)Socket->acceptTo(Socket $connection, ?int $timeout = null)
  • 允许创建socket时不指定类型(使用TYPE_ANY)
  • 修改Http\Server->acceptConnection签名为Http\Server->acceptConnection(?int $timeout = null, ?Connection $connection = null)
  • 修改Signal::wait()函数签名为Socket::wait(int $num, int $timeout = -1) ($timeout默认值为不超时)
  • 修改Socket->accept()函数签名为Socket->accept(?Socket $connection = null, ?int $timeout = null) (参数名修改)
  • 重命名 Util\copyDir -> Util\touchDir
  • 重命名 {Http\Status, Websocket\Opcode, WebSocket\Status}::{getName, getReasonPhrase, getDescription} -> {getNameFor, getReasonPhraseFor, getDescriptionFor}
  • 重命名 Http\TypeInterface -> Http\ProtocolTypeInterface
  • 移动方法 Http\RawResult->{$isUpgrade, $uploadedFiles} -> Http\RawRequest->{$isUpgrade, $uploadedFiles}
  • 修改Coroutine->call() 签名为Coroutine->call(callable $callable, int $level = 0)(添加$level 参数)
  • 移动Swow\WebSocket中的命名空间常量为Swow\WebSocket类常量
  • 重构\Http\BodyParser
  • 修改Socket::__construct(int $type)(移除了默认值)
  • 修改WaitReference::wait(self &$ref, int $timeout = -1): void(修改参数名称)
  • 移动常量Channel::OPCODE_*Channel\Selector::EVENT_*
  • 支持在Socket->enableCrypto(?array $options = null)中设置tls选项

Fix

  • Fix Typed property Swow\Http\ServerRequest::$parsedBody must not be accessed before initialization (#104)
  • Fix defer is not executed correctly after coroutine exit(#112)
  • Fix some minor problem in ZTS build
  • Update cURL related behavior (fixes some assertion failure)
  • Fix segfault when openssl is not enabled
  • Fix Coroutine::getCurrent, Coroutine::getMain Coroutine::getPrevious Buffer->copy functions signature
  • Fix Socket->sendTo Socket->writeTo Socket->sendStringTo arguments type hint
  • Fix Coroutine->setLocalVar() memory corruption
  • Fix frame skipping behavior in debug functions
  • Fix Coroutine::getExecutedFunctionName() method name
  • Fix setUri(UriInterface $uri, ?bool $preserveHost = null): static method signature
  • Fix "Cannot unpack array with string keys"
  • Fix HTTP parser dead loop at specified condition

Addition Removal Change

  • Support Closure serialization
  • Added proc_open hook
  • Implemented serverParams and cookieParams for PSR style $_SERVER usage
  • HTTP parser now supports multipart file upload (Http\Parser->isMultipart(): bool method Http\UploadFile Http\RawUploadFile class array Http\RawResult->$uploadedFiles e.t.c)
  • HTTP parser now supports chunked encoding (Http\Parser->isChunked():bool Http\Parser->getCurrentChunkLength(): int e.t.c)
  • Added many in-code documents and annotations for statically analizing
  • Added Coroutine::registerDeadlockHandler(callable $callable): Util\Handler API
  • Added Socket->getSimpleType(): int Socket->getSimpleTypeName(): string Socket::typeSimplify(int $type): int Socket::typeName(int $type): string Socket->getId(): int API
  • Added Http\Server\Connection->recvHttpRequestTo(Request $request): Request Http\WebSocketTrait->recvWebSocketFrameTo(WebSocketFrame $frame): WebSocketFrame API
  • Added Http\MimeType Stream\Psr7Stream classes
  • Added more socket options support
  • Added ConnectionManagerTrait->getConnections(): array API
  • Added more mime type constants
  • Added Http\Message->detectContentLength(): int API
  • Added Object\DupTrait trait
  • Added Http\Uri::from(UriInterface|string $uri): static API
  • Added Coroutine->isExecuting(): bool API
  • Remove Http\Server\Connection->setServer(), refactor Http\Server\Connection constructor to __construct(Server $server)
  • Remove Http\Message->getBodyAsString()
  • Remove Buffer->copy()
  • Optimize code (#109)
  • Move errno constants to Errno final class
  • Move namespace constants to Swow final class
  • Rename Yyyy\Xxxx\Exception to Yyyy\XxxxException (#108)
  • Now $capacity = -1 indicates unlimited capacity for Channel
  • Now bind, accept and connect in PHP stream returns original system error code
  • Split Socket->accept() into Socket->accept(?int $timeout = null) and Socket->acceptTo(Socket $connection, ?int $timeout = null)
  • Allow create socket object without type specified (using TYPE_ANY flag)
  • Refactor Http\Server->acceptConnection to Http\Server->acceptConnection(?int $timeout = null, ?Connection $connection = null)
  • Refactor Signal::wait() to Socket::wait(int $num, int $timeout = -1) ($timeout now have a -1 default value for no time limit)
  • Refactor Socket->accept() signature to Socket->accept(?Socket $connection = null, ?int $timeout = null) (argument name changes)
  • Rename Util\copyDir -> Util\touchDir
  • Rename {Http\Status, Websocket\Opcode, WebSocket\Status}::{getName, getReasonPhrase, getDescription} -> {getNameFor, getReasonPhraseFor, getDescriptionFor}
  • Rename Http\TypeInterface -> Http\ProtocolTypeInterface
  • Move Http\RawResult->{$isUpgrade, $uploadedFiles} -> Http\RawRequest->{$isUpgrade, $uploadedFiles}
  • Refactor Coroutine->call() signature to Coroutine->call(callable $callable, int $level = 0) (add $level param)
  • Move namespace constants in Swow\WebSocket to Swow\WebSocket class constant
  • Refactor \Http\BodyParser class
  • Refactor Socket::__construct(int $type) (removed default value)
  • Refactor WaitReference::wait(self &$ref, int $timeout = -1): void (argument name changes)
  • Move Channel::OPCODE_* to Channel\Selector::EVENT_*
  • Support setting tls options in Socket->enableCrypto(?array $options = null)

Hashes and notes

*.pdb是调试符号,仅使用Swow不需要下载 *.pdb is debug symbols, not necessary for using Swow

File name Size (in bytes) SHA256 sum Build log Tests result
php_swow-php8.0-x64-nts-VS16.dll 1126912 D9A3D121365810EE4EC4B07FDAF2D29192E290417229280E02736B158729170C link success
php_swow-php8.0-x64-ts-VS16.dll 1153536 AEFD772B5B0C17BCF95687B6B7730128821D725612EFCBB420495ED2F63F0A6B link success
php_swow-php8.1-x64-nts-VS16.dll 1134592 F4EC39FCD862B4B7B7E5989EA07EC21C7D033AA4DEEFEABD2CD08977331082A5 link success
php_swow-php8.1-x64-ts-VS16.dll 1161728 9CECA2E59F1380EB69E9CB9D4155DD50267D3CAF13392C55BB92A23DAC8A82B6 link success

v0.1.0-nightly20220116

2 years ago

修复

  • 现在SSL socket的超时时间被正确设置了
  • 修复了被弃用的ini配置导致的重复报错
  • 修复stream_socket_enable_cypto()总是返回0的问题
  • 修复SSL流客户端开启
  • 修复部分报错信息
  • 跟从PHP主线的socket bind行为

增加 删除 修改

  • 添加Signal::kill($pid, $signum)静态方法
  • 添加Debugger::showExecutedSourceLines()静态方法
  • 添加Buffer->lock(), Buffer->tryLock(), Buffer->unlock()方法允许
  • 添加Swow\Stream\EofStream
  • 添加Socket->isOpen():bool, Socket->isServer():bool, Socket->isServerConnection():bool, Socket->isClient():bool方法
  • 抛弃PHP7支持
  • 改变length参数的行为: 现在-1代表不限制长度
  • 修改协程调度模型以精简代码提高效率

Fix

  • SSL socket timeout is corrected
  • Fixed duplicate warnings when using deprecated ini entries
  • Fixed stream_socket_enable_cypto() return value
  • Fixed corrupt SSL client
  • Fixed some corrupt error messages
  • Follow master PHP socket stream bind behavior

Addition Removal Change

  • Add Signal::kill($pid, $signum) static method
  • Add Debugger::showExecutedSourceLines() static method
  • Add Buffer->lock(), Buffer->tryLock(), Buffer->unlock() methods for user locking/unlocking buffer
  • Add Swow\Stream\EofStream class
  • Add Socket->isOpen():bool, Socket->isServer():bool, Socket->isServerConnection():bool, Socket->isClient():bool methods
  • Drop PHP7 support
  • Refactor length arguments behavior and theirs default value: now -1 meaning unlimited
  • Refactor coroutine model to reduce codes and improve performance

Hashes and notes

File name Size (in bytes) SHA256 sum Build log Tests result
php_swow-php8.0-x64-nts-VS16.dll 1103872 90502A9940C5CB98525017EA1797B9291479F1562676DE8A162A5ED4B142FA46 link failure(ci problem)
php_swow-php8.0-x64-ts-VS16.dll 1129472 A3A08A700142E7EBF516DC7A00FDEC408AB31B5ED6AE16130FA221DFA5FD2C65 link failure(ci problem)
php_swow-php8.1-x64-nts-VS16.dll 1111040 A790F78731FFB550C0FB766054E8091898689E080318A9B6B8E48E2A76EBBEBB link failure(ci problem)
php_swow-php8.1-x64-ts-VS16.dll 1137664 22FBC6D6442010A2F65078EA2B4504C130F56054A3002E65D1D04AD50B123047 link failure(ci problem)

v0.1.0-nightly20210910

2 years ago

教师节快乐

修复与优化

  • 修复了大量bug
  • 修复builder中的问题(#86) by @her-cat
  • 优化库代码(#87) by @codingheping
  • 统一调试相关函数(如Coroutine->getTrace($level, ...))调用栈层级参数的使用方式
  • 不再hook通过ini禁用的内置函数
  • 跟从最新PHP更新fs hook行为
  • 变更Coroutine::getCurrentRound()为静态方法

增加 删除 修改

  • 添加大量PHPT对C代码进行测试
  • 弃用协程构造中的栈大小参数避免错误的设置导致栈溢出
  • 添加Socket->getConnectionError()
  • 添加Socket->sendHandle() Socket->recvHandle()Socket->acceptTyped()
  • 重命名Buffer->truncate($offset, $length)方法为Buffer->truncateFrom($offset, $length),添加Buffer->truncate($length)方法
  • 重命名Server\SessionServer\Connection
  • 添加SSL部分支持

构建相关

  • 提高支持版本到PHP8.2
  • 添加ASan MSan UBSan构建支持
  • 添加gcov覆盖率测试构建支持
  • 添加BSD,Solaris和Haiku构建支持
  • 添加riscv64架构构建支持

Hashes and notes

File name Size (in bytes) SHA256 sum Build log Tests result
php_swow-php7.3-x64-nts-VC15.dll 1060864 3BFBBEB322BB59AB972C2304C124C28C78ECA3364ECF400F37AB5DE2EF1B5D96 link success
php_swow-php7.3-x64-ts-VC15.dll 1086976 F8EC87A7B936BEF18ED52833D0069162430BAF681444323D0E54C63F2A684D20 link success
php_swow-php7.4-x64-nts-VC15.dll 1062912 A8CD27F5D9FABA0FD1AAB6614E5F66FF78C7DF6502D93CDAEE2384EF057D4B5D link success
php_swow-php7.4-x64-ts-VC15.dll 1086976 7439D11648FEA032F257F2E979AE071245ACE2581578799D5405E2EFA03D6267 link success
php_swow-php8.0-x64-nts-VS16.dll 1092096 FB35B17C2D5D37F8DA099D804A7038769DFD16D4D8BD5A6685565E974DF89E3B link success
php_swow-php8.0-x64-ts-VS16.dll 1116672 570CD1F2AD5E2540DB610CD107FE323106F129A8584BB2524DDDEA0DF687B19B link success

v0.1.0-nightly20210601

2 years ago

六一儿童节快乐 Happy Children's Day

  • 修复了一些已知bug

Hashes and notes

File name Size (in bytes) SHA256 sum Build log Tests result
php_swow-php8.0-x64-nts-VS16.dll 1041920 5DB1121B2B0E42296FBEC8064F103B3311C1A70320A1DDB28AFF08E359D603F7 link skipped
php_swow-php8.0-x64-ts-VS16.dll 1065984 9F285633E92C90DFE12830648A06E4FA77D57A39EAC6E650E042D73FEA9B6476 link skipped
php_swow-php7.4-x64-nts-VC15.dll 1019392 738DDC8830D4F37C19E1C2613D3837FAE3A6D32B638D0937F04DE85C3AD6C651 link skipped
php_swow-php7.4-x64-ts-VC15.dll 1042944 7B192033098BA49E4B3B2A42BE252B6F18ABD1B659418B066F93E28CCAF53287 link skipped
php_swow-php7.3-x64-nts-VC15.dll 1018368 591D2E8EAC92B792D03E2B5BB72D404F4F564C4BCBA835627F0579029C1F2BD4 link skipped
php_swow-php7.3-x64-ts-VC15.dll 1042944 035603591989DE7B85783C1B0BAF7A33C69D68A3BBEEA6D13B4AA4D8B07AF80E link skipped

v0.1.0-nightly20210514

2 years ago

周末快乐

  • curl协程化
  • 文件IO操作协程化
  • 重构phar支持

Hashes and notes

File name Size (in bytes) SHA256 sum Build log Tests result
php_swow-php8.0-x64-nts-VS16.dll 1046016 D4E50477B96B9ADD5C71B9BADBE884ADC86E26EA804706066C2D7C2963098976 link buggy curl
php_swow-php8.0-x64-ts-VS16.dll 1069568 EBC29C65917FEED1B8CF7B234DDE5E4A55E038395C75CFFD2BCC62E8138B2732 link buggy curl
php_swow-php7.4-x64-nts-VC15.dll 1019392 F8F94FCCBFB398DFEEF31077F587385E746A8B2B4205D89EAA6D69EC23C52453 link success
php_swow-php7.4-x64-ts-VC15.dll 1042432 D8313A21F5B33414C495018ACFA886680ACAF606384CBF036D6675E70AF350E7 link success
php_swow-php7.3-x64-nts-VC15.dll 1017856 2FA4F68D5F5BC8AC4B938384AB39A3B95606C30031DF6BB73CD48CE91E111D0E link success
php_swow-php7.3-x64-ts-VC15.dll 1042432 18E31A86E42959D7ABBD7F996C6C0CBE38291A706780296A6CC1383AE1B17484 link success

v0.1.0-nightly20210308

3 years ago

The first nightly version, have fun :)

第一个每日构建版本,三八妇女节快乐~

Hashes and notes

File name Size (in bytes) SHA256 sum Build log Tests result
php_swow-php8.0-x64-nts-VS16.dll 481792 3C429A0CE41792959A172F10A4D9EF72F3EEF51344996F43210C0A579586C681 link success
php_swow-php8.0-x64-ts-VS16.dll 497664 1E9BFA06322FACAB8B22C9F8DC4F375028FD8C73F2AD156C156D24E8555122F7 link success
php_swow-php7.4-x64-nts-VC15.dll 481280 D8C4FF7E1F2ECBD6C5BD144D09B531F96F44B9BA3109B80C1F567FD1778DFE37 link success
php_swow-php7.4-x64-ts-VC15.dll 496640 4B947EEB56C074B60D96D2B9E4AAF92CF8AC980062B0AFAE6E7F54A875FBC44F link success
php_swow-php7.3-x64-nts-VC15.dll 481280 576B54E42F895867821A0196B38D28CE7CDAEFB2190AD59F5EA6B1D2B9457238 link success
php_swow-php7.3-x64-ts-VC15.dll 497664 6BB24FC9BF0595D3774FB0F9ACEF4A53C0B993AA6B8058FCB6F34264A8651845 link success