wdvi

network DVI viewer
Log | Files | Refs

commit 7b370c55f48760d59c1b26ebcb289fffb78e6dbf
parent f16a22fb193d673187e1a198ab625548a1200995
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Fri, 10 Sep 2021 16:41:04 +0000

s/response/resp/g

Diffstat:
Mhttp.c | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/http.c b/http.c @@ -364,7 +364,7 @@ static FILE * read_response(SSL *tls, struct url *url) { char *buf; - struct http_headers *response; + struct http_headers *resp; int nbytes = 0; int total_bytes = 0; FILE *dvi_file = NULL; @@ -380,30 +380,30 @@ read_response(SSL *tls, struct url *url) } /* We must free returned response. */ - if ((response = parse_headers(buf, nbytes)) == NULL) { + if ((resp = parse_headers(buf, nbytes)) == NULL) { warning_popup_long("%s: malformed HTTP header", "OK", NULL, url->hostname); goto free_buf; } - if (response->stat != 200) { + if (resp->stat != 200) { warning_popup_long("%s: %i %s", "OK", NULL, url->orig_url, - response->stat, response->stat_text); - goto free_response; + resp->stat, resp->stat_text); + goto free_resp; } /* XDvi does all its processing with FILE streams. */ - if ((dvi_file = fmemopen(NULL, response->cont_len, "r+")) == NULL) + if ((dvi_file = fmemopen(NULL, resp->cont_len, "r+")) == NULL) err(1, "fmemopen"); /* Second (or more) reads are the HTTP body response. */ - while (total_bytes < response->cont_len) { + while (total_bytes < resp->cont_len) { if ((nbytes = SSL_read(tls, buf, SSL_BUF_SIZE)) < 1) { warning_popup_long("SSL_read: %s: %s", "OK", NULL, url->hostname, SSL_strerror(tls, nbytes)); fclose(dvi_file); dvi_file = NULL; - goto free_response; + goto free_resp; } if (fwrite(buf, 1, nbytes, dvi_file) < nbytes) @@ -417,12 +417,12 @@ read_response(SSL *tls, struct url *url) printf("Number of HTTP body bytes: %i\n", total_bytes); - if (total_bytes != response->cont_len) + if (total_bytes != resp->cont_len) warning_popup_long("HTTP body len: expected %i but read %i\n", - "OK", NULL, response->cont_len, nbytes); + "OK", NULL, resp->cont_len, nbytes); -free_response: - free(response); +free_resp: + free(resp); free_buf: free(buf);