Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .release-notes/next-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Fix a request hanging when its connection closed

A request closes its connection when handling a redirect, when the response is complete, or on a parse error. That close could leave the connection issuing one more read on the closed socket. When many requests run at once, that read could block a scheduler thread and prevent the program from exiting.

## Fix a connection stalling under sustained write backpressure

Under sustained write backpressure with the server still sending, a connection could stall permanently: data stopped moving in both directions, and the connection stayed wedged until closed. This was most likely on a multi-threaded runtime.

## Fix a hang when writing to a socket under load

Under write load, sending on a connection could hang the program. This required the operating system to reuse a closed connection's file descriptor for a blocking socket elsewhere in the process — rare, but possible. The hang is fixed on Linux, FreeBSD, OpenBSD, and DragonFly. macOS and Windows are unchanged.

## Fix TLS bugs that could misreport handshake failures, drop data, or close the wrong connection

TLS connection handling had bugs that could cause handshake failures to be misreported, data to be silently dropped during encrypted writes, and one connection's TLS failure to close a different connection.

## Fix a macOS bug where setting up a connection could close an unrelated file descriptor

On macOS, setting up a connection could close one of its own file descriptors twice. The operating system can hand that descriptor number to something else in between, so the second close lands on an unrelated connection or file. Connecting to a host that resolves to more than one address is the likeliest way to hit it. The same cleanup also miscounted outstanding connection attempts, which could abandon a working attempt and report the connection as failed, or leave a connection asked to close gracefully never finishing. Linux and Windows were not affected.

## Fix TLS connections not sending close_notify on graceful close

Closing a TLS connection now sends a `close_notify` alert before the TCP shutdown. Without it, the server could not distinguish a clean close from a truncated stream.

## Drop support for OpenSSL 0.9.x

Building with `ssl=0.9.0` is no longer supported. OpenSSL 0.9.x has been end-of-life since 2016; use OpenSSL 1.1.x or 3.0.x.

## Require ponyc 0.67.0 or later

github_rest_api now requires ponyc 0.67.0 or later on every platform. The previous minimum was 0.66.0 on Windows and 0.64.0 on other platforms; 0.64.0 through 0.66.x are no longer supported.
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ make config=debug ssl=3.0.x # debug build
make clean # clean build artifacts + corral deps
```

`ssl=` is required on every build and test target, set to your installed TLS library: `3.0.x`, `1.1.x`, or `0.9.0`. `make` runs `corral fetch` before compiling.
`ssl=` is required on every build and test target, set to your installed TLS library: `3.0.x` or `1.1.x`. `make` runs `corral fetch` before compiling.

## Architecture

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ All notable changes to this project will be documented in this file. This projec

### Fixed

- Fix a request hanging when its connection closed ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))
- Fix a connection stalling under sustained write backpressure ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))
- Fix a hang when writing to a socket under load ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))
- Fix TLS bugs that could misreport handshake failures, drop data, or close the wrong connection ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))
- Fix a macOS bug where setting up a connection could close an unrelated file descriptor ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))
- Fix TLS connections not sending close_notify on graceful close ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))

### Added


### Changed

- Drop support for OpenSSL 0.9.x ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))
- Require ponyc 0.67.0 or later ([PR #137](https://github.com/ponylang/github_rest_api/pull/137))


## [0.7.0] - 2026-06-30

Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ ifeq (,$(filter $(MAKECMDGOALS),clean docs realclean TAGS))
SSL = -Dopenssl_3.0.x
else ifeq ($(ssl), 1.1.x)
SSL = -Dopenssl_1.1.x
else ifeq ($(ssl), 0.9.0)
SSL = -Dopenssl_0.9.0
else
$(error Unknown SSL version "$(ssl)". Must set using 'ssl=FOO')
endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Additional API surface and functionality will be added as needed. If you need fu

## Installation

* Requires ponyc 0.65.0 or later. On Windows, requires ponyc 0.66.0 or later.
* Requires ponyc 0.67.0 or later.
* Install [corral](https://github.com/ponylang/corral)
* `corral add github.com/ponylang/github_rest_api.git --version 0.7.0`
* `corral fetch` to fetch your dependencies
Expand Down
6 changes: 5 additions & 1 deletion corral.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
},
{
"locator": "github.com/ponylang/courier.git",
"version": "0.4.0"
"version": "0.5.0"
},
{
"locator": "github.com/ponylang/ssl.git",
"version": "4.0.0"
},
{
"locator": "github.com/ponylang/uri.git",
Expand Down
3 changes: 2 additions & 1 deletion github_rest_api/_test_mock_http_server.pony
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ actor \nodoc\ _MockHTTPConnection
fun ref _connection(): lori.TCPConnection =>
_tcp_connection

fun ref _on_received(data: Array[U8] iso) =>
fun ref _on_received(data: Array[U8] iso): lori.ReadAction =>
_buf.append(consume data)
if _buf.contains("\r\n\r\n") then
let request: String val = (_buf = String).clone()
let response = _responder(request)
_tcp_connection.send(response)
end
lori.KeepReading
Loading