swow

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

APACHE-2.0 License

Downloads
1.3M
Stars
1.1K
Committers
21

Bot releases are hidden (Show)

swow - v0.3.2-alpha

Published by twose almost 2 years ago

swow - v0.3.1-alpha

Published by twose almost 2 years ago

Fixes

Optimizations

New Contributors

Full Changelog: https://github.com/swow/swow/compare/v0.3.0-alpha...v0.3.1-alpha

swow - v0.3.0-alpha

Published by twose almost 2 years ago

TL;DR

API向下不兼容变更:

  • maskKey 重命名为 maskingKey (与RFC保持一致)

修复:

  • 修复builder由于找不到autoload.php而无法使用的问题 (#138)
  • WebSocket Frame 没有自动unmask的问题

优化:

  • 完善了一些注释
  • sync-extension 命令重命名为语义更明确的 sync-dependencies (仅内核开发者使用)
  • 新增一个版本信息更新脚本用于快速替换版本号定义
swow - v0.2.0-alpha.1

Published by dixyes almost 2 years 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
swow - v0.1.0-nightly20220722

Published by twose about 2 years 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