comparison src/event/ngx_event_quic.c @ 8217:a5a1b3fad834 quic

Fixed sanitizer errors.
author Roman Arutyunyan <arut@nginx.com>
date Fri, 13 Mar 2020 20:44:32 +0300
parents 0aec63f50c29
children 33feac1e57ac
comparison
equal deleted inserted replaced
8216:0aec63f50c29 8217:a5a1b3fad834
1932 1932
1933 static ssize_t 1933 static ssize_t
1934 ngx_quic_stream_send(ngx_connection_t *c, u_char *buf, size_t size) 1934 ngx_quic_stream_send(ngx_connection_t *c, u_char *buf, size_t size)
1935 { 1935 {
1936 u_char *p; 1936 u_char *p;
1937 ngx_connection_t *pc;
1937 ngx_quic_frame_t *frame; 1938 ngx_quic_frame_t *frame;
1938 ngx_quic_stream_t *qs; 1939 ngx_quic_stream_t *qs;
1939 ngx_quic_connection_t *qc; 1940 ngx_quic_connection_t *qc;
1940 ngx_quic_stream_node_t *sn; 1941 ngx_quic_stream_node_t *sn;
1941 1942
1942 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "quic send: %uz", size); 1943 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "quic send: %uz", size);
1943 1944
1944 qs = c->qs; 1945 qs = c->qs;
1945 qc = qs->parent->quic; 1946 pc = qs->parent;
1946 1947 qc = pc->quic;
1947 1948
1948 // XXX: get direct pointer from stream structure? 1949 // XXX: get direct pointer from stream structure?
1949 sn = ngx_quic_stream_lookup(&qc->stree, qs->id); 1950 sn = ngx_quic_stream_lookup(&qc->stree, qs->id);
1950 1951
1951 if (sn == NULL) { 1952 if (sn == NULL) {
1952 return NGX_ERROR; 1953 return NGX_ERROR;
1953 } 1954 }
1954 1955
1955 frame = ngx_pcalloc(c->pool, sizeof(ngx_quic_frame_t)); 1956 frame = ngx_pcalloc(pc->pool, sizeof(ngx_quic_frame_t));
1956 if (frame == NULL) { 1957 if (frame == NULL) {
1957 return 0; 1958 return 0;
1958 } 1959 }
1959 1960
1960 p = ngx_pnalloc(c->pool, size); 1961 p = ngx_pnalloc(pc->pool, size);
1961 if (p == NULL) { 1962 if (p == NULL) {
1962 return 0; 1963 return 0;
1963 } 1964 }
1964 1965
1965 ngx_memcpy(p, buf, size); 1966 ngx_memcpy(p, buf, size);