Skip to content

Instantly share code, notes, and snippets.

View xeioex's full-sized avatar

Dmitry Volyntsev xeioex

View GitHub Profile
#!/usr/bin/perl
# (C) Dmitry Volyntsev
# (C) Nginx, Inc.
# Tests for http njs module, fetch method with HTTPS through forward proxy.
###############################################################################
use warnings;
@xeioex
xeioex / p
Created September 29, 2025 05:29
diff --git a/src/acme/solvers/tls_alpn.rs b/src/acme/solvers/tls_alpn.rs
index 4143f83..f7fa6ae 100644
--- a/src/acme/solvers/tls_alpn.rs
+++ b/src/acme/solvers/tls_alpn.rs
@@ -537,7 +537,7 @@ fn acme_parse_ssl_server_name(
let mut addr: u128 = 0;
let mut it = v6.as_bytes().split(|x| *x == b'.');
- for i in (0..128).step_by(4) {
+ for i in 0..32 {
commit f422b9f7f4b1a0d8a7f98a3b2702e87a997d7515
Author: Dmitry Volyntsev <[email protected]>
Date: Tue Sep 16 18:28:05 2025 -0700
Fixed build with gcc-15 and -O3.
build/src/njs_object.dep -MT build/src/njs_object.o \ src/njs_object.c
In file included from src/njs_main.h:18, from src/njs_object.c:8: In
function ‘njs_utf8_copy’, inlined from ‘njs_object_enumerate_string’ at
src/njs_object.c:769:21: src/njs_utf8.h:115:20: error: writing 1 byte
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 736635cd..f9d9721a 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -565,6 +565,34 @@ static ngx_command_t ngx_http_js_commands[] = {
0,
NULL },
+ { ngx_string("js_fetch_keepalive"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Anki TXT Cards Creator
Создает объединенные файлы карточек в формате .txt для импорта в Anki
Поддерживает обработку множества JSON файлов через glob patterns
"""
import json
import os
// Copyright (c) F5, Inc.
//
// This source code is licensed under the Apache License, Version 2.0 license found in the
// LICENSE file in the root directory of this source tree.
use core::cell::RefCell;
use core::ptr::NonNull;
use core::time::Duration;
use std::collections::VecDeque;
use std::string::{String, ToString};
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 145c1955..32da434f 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -5905,12 +5905,14 @@ ngx_http_qjs_ext_subrequest(JSContext *cx, JSValueConst this_val,
"the primary request");
}
- if (ngx_qjs_string(cx, argv[0], &uri) != NGX_OK) {
- return JS_ThrowTypeError(cx, "failed to convert uri arg");

In addition to the previous instructions, please check PRs for style.

C Code Style Guide

  • apply general C style for C code in all directories
  • apply njs style in the src/ directory, see directory-specific rules below
  • apply nginx style in the nginx/ directory, see directory-specific rules below

General Rules

  • maximum text width is 80 characters

In addition to the previous instructions, please check PRs for style.

C Code Style Guide

General Rules

  • maximum text width is 80 characters
  • indentation is 4 spaces
  • no tabs, no trailing spaces
  • list elements on the same line are separated with spaces

In addition to the previous instructions, check PRs for coding style.

Njs project style guide

  • applies to C source code in src/ directory

General rules

  • maximum text width is 80 characters
  • indentation is 4 spaces
  • no tabs, no trailing spaces