Welcome! Log In Create A New Profile

Advanced

[njs] Fetch: renamed prefix http to fetch to avoid overlap with HTTP module.

Dmitry Volyntsev
September 08, 2023 09:02PM
details: https://hg.nginx.org/njs/rev/947f3b18dde4
branches:
changeset: 2196:947f3b18dde4
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Sep 08 17:52:07 2023 -0700
description:
Fetch: renamed prefix http to fetch to avoid overlap with HTTP module.

diffstat:

nginx/ngx_js_fetch.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)

diffs (149 lines):

diff -r 78c1ef3eeaa9 -r 947f3b18dde4 nginx/ngx_js_fetch.c
--- a/nginx/ngx_js_fetch.c Fri Sep 08 16:05:24 2023 -0700
+++ b/nginx/ngx_js_fetch.c Fri Sep 08 17:52:07 2023 -0700
@@ -1308,7 +1308,7 @@ ngx_js_http_alloc(njs_vm_t *vm, ngx_pool

http->vm_event = vm_event;

- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, "js http alloc:%p", http);
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, "js fetch alloc:%p", http);

return http;

@@ -1408,7 +1408,7 @@ static void
ngx_js_http_close_connection(ngx_connection_t *c)
{
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "close js http connection: %d", c->fd);
+ "js fetch close connection: %d", c->fd);

#if (NGX_SSL)
if (c->ssl) {
@@ -1434,7 +1434,7 @@ njs_js_http_destructor(njs_external_ptr_

http = host;

- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, http->log, 0, "js http destructor:%p",
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, http->log, 0, "js fetch destructor:%p",
http);

if (http->ctx != NULL) {
@@ -1549,7 +1549,7 @@ ngx_js_http_connect(ngx_js_http_t *http)
addr = &http->addrs[http->naddr];

ngx_log_debug2(NGX_LOG_DEBUG_EVENT, http->log, 0,
- "js http connect %ui/%ui", http->naddr, http->naddrs);
+ "js fetch connect %ui/%ui", http->naddr, http->naddrs);

http->peer.sockaddr = addr->sockaddr;
http->peer.socklen = addr->socklen;
@@ -1605,7 +1605,8 @@ ngx_js_http_ssl_init_connection(ngx_js_h
c = http->peer.connection;

ngx_log_debug2(NGX_LOG_DEBUG_EVENT, http->log, 0,
- "js http secure connect %ui/%ui", http->naddr, http->naddrs);
+ "js fetch secure connect %ui/%ui", http->naddr,
+ http->naddrs);

if (ngx_ssl_create_connection(http->ssl, c, NGX_SSL_BUFFER|NGX_SSL_CLIENT)
!= NGX_OK)
@@ -1663,15 +1664,14 @@ ngx_js_http_ssl_handshake(ngx_js_http_t

if (rc != X509_V_OK) {
ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "js http fetch SSL certificate verify "
- "error: (%l:%s)", rc,
- X509_verify_cert_error_string(rc));
+ "js fetch SSL certificate verify error: (%l:%s)",
+ rc, X509_verify_cert_error_string(rc));
goto failed;
}

if (ngx_ssl_check_host(c, &http->tls_name) != NGX_OK) {
ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "js http SSL certificate does not match \"%V\"",
+ "js fetch SSL certificate does not match \"%V\"",
&http->tls_name);
goto failed;
}
@@ -1728,7 +1728,7 @@ ngx_js_http_ssl_name(ngx_js_http_t *http
name->data = p;

ngx_log_debug1(NGX_LOG_DEBUG_EVENT, http->log, 0,
- "js http SSL server name: \"%s\"", name->data);
+ "js fetch SSL server name: \"%s\"", name->data);

if (SSL_set_tlsext_host_name(http->peer.connection->ssl->connection,
(char *) name->data)
@@ -1751,7 +1751,7 @@ done:
static void
ngx_js_http_next(ngx_js_http_t *http)
{
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, http->log, 0, "js http next");
+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, http->log, 0, "js fetch next addr");

if (++http->naddr >= http->naddrs) {
ngx_js_http_error(http, 0, "connect failed");
@@ -1780,7 +1780,7 @@ ngx_js_http_write_handler(ngx_event_t *w
c = wev->data;
http = c->data;

- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, wev->log, 0, "js http write handler");
+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, wev->log, 0, "js fetch write handler");

if (wev->timedout) {
ngx_js_http_error(http, NGX_ETIMEDOUT, "write timed out");
@@ -1862,7 +1862,7 @@ ngx_js_http_read_handler(ngx_event_t *re
c = rev->data;
http = c->data;

- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, rev->log, 0, "js http read handler");
+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, rev->log, 0, "js fetch read handler");

if (rev->timedout) {
ngx_js_http_error(http, NGX_ETIMEDOUT, "read timed out");
@@ -2340,7 +2340,7 @@ ngx_js_http_process_status_line(ngx_js_h
rc = ngx_js_http_parse_status_line(hp, http->buffer);

if (rc == NGX_OK) {
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, http->log, 0, "js http status %ui",
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, http->log, 0, "js fetch status %ui",
hp->code);

http->response.code = hp->code;
@@ -2373,7 +2373,7 @@ ngx_js_http_process_headers(ngx_js_http_
ngx_js_http_parse_t *hp;

ngx_log_debug0(NGX_LOG_DEBUG_EVENT, http->log, 0,
- "js http process headers");
+ "js fetch process headers");

hp = &http->http_parse;

@@ -2403,7 +2403,7 @@ ngx_js_http_process_headers(ngx_js_http_
}

ngx_log_debug4(NGX_LOG_DEBUG_EVENT, http->log, 0,
- "js http header \"%*s: %*s\"",
+ "js fetch header \"%*s: %*s\"",
len, hp->header_name_start, vlen, hp->header_start);

if (len == njs_strlen("Transfer-Encoding")
@@ -2473,7 +2473,7 @@ ngx_js_http_process_body(ngx_js_http_t *
ngx_buf_t *b;

ngx_log_debug1(NGX_LOG_DEBUG_EVENT, http->log, 0,
- "js http process body done:%ui", (ngx_uint_t) http->done);
+ "js fetch process body done:%ui", (ngx_uint_t) http->done);

if (http->done) {
size = njs_chb_size(&http->response.chain);
@@ -3156,7 +3156,7 @@ ngx_js_http_parse_chunked(ngx_js_http_ch
static void
ngx_js_http_dummy_handler(ngx_event_t *ev)
{
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0, "js http dummy handler");
+ ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0, "js fetch dummy handler");
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fetch: renamed prefix http to fetch to avoid overlap with HTTP module.

Dmitry Volyntsev 225 September 08, 2023 09:02PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 83
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready