Skip to content
Permalink
Browse files

Wrap some long lines.

  • Loading branch information...
schmonz committed Apr 28, 2019
1 parent a5d2476 commit c010e2e48a8d1e97ef949044399d0148c9c25c4a
Showing with 27 additions and 6 deletions.
  1. +27 −6 fixsmtpio_proxy.c
@@ -191,7 +191,10 @@ static void handle_data_specially(stralloc *data,int *in_data,stralloc *logstamp
*in_data = 0;
}

static void handle_request(stralloc *proxy_request,stralloc *request,int tls_level,int *want_tls,int in_tls,int *want_data,filter_rule *rules,stralloc *logstamp) {
static void handle_request(stralloc *proxy_request,stralloc *request,
int tls_level,int *want_tls,int in_tls,
int *want_data,
filter_rule *rules,stralloc *logstamp) {
stralloc event = {0}, verb = {0}, arg = {0};

logit(logstamp,'1',request);
@@ -209,7 +212,12 @@ static void handle_request(stralloc *proxy_request,stralloc *request,int tls_lev
logit(logstamp,'2',proxy_request);
}

static void handle_response(stralloc *proxy_response,int *exitcode,stralloc *response,int tls_level,int want_tls,int in_tls,int *want_data,int *in_data,filter_rule *rules,stralloc *greeting,stralloc *logstamp) {
static void handle_response(int *exitcode,
stralloc *proxy_response,stralloc *response,
int tls_level,int want_tls,int in_tls,
int *want_data,int *in_data,
filter_rule *rules,stralloc *greeting,
stralloc *logstamp) {
char *event;
logit(logstamp,'3',response);
event = eventq_get();
@@ -352,24 +360,37 @@ int read_and_process_until_either_end_closes(int from_client,int to_server,
if (can_read(from_client)) {
if (!safeappend(&client_requests,from_client,buf,sizeof buf)) {
// XXX maybe telnet and Ctrl-C gets here??
munge_response_line(0,&client_requests,&exitcode,greeting,rules,EVENT_CLIENTEOF,tls_level,in_tls);
munge_response_line(0,
&client_requests,&exitcode,
greeting,rules,EVENT_CLIENTEOF,
tls_level,in_tls);
break;
}
while (client_requests.len) {
if (in_data) {
handle_data_specially(&client_requests,&in_data,logstamp);
safewrite(to_server,&client_requests);
} else if (get_one_request(&one_request,&client_requests)) {
handle_request(&proxy_request,&one_request,tls_level,&want_tls,in_tls,&want_data,rules,logstamp);
handle_request(&proxy_request,&one_request,
tls_level,&want_tls,in_tls,
&want_data,
rules,logstamp);
safewrite(to_server,&proxy_request);
}
}
}

if (can_read(from_server)) {
if (!safeappend(&server_responses,from_server,buf,sizeof buf)) break;
while (server_responses.len && exitcode == EXIT_LATER_NORMALLY && get_one_response(&one_response,&server_responses)) {
handle_response(&proxy_response,&exitcode,&one_response,tls_level,want_tls,in_tls,&want_data,&in_data,rules,greeting,logstamp);
while (server_responses.len
&& exitcode == EXIT_LATER_NORMALLY
&& get_one_response(&one_response,&server_responses)) {
handle_response(&exitcode,
&proxy_response,&one_response,
tls_level,want_tls,in_tls,
&want_data,&in_data,
rules,greeting,
logstamp);
safewrite(to_client,&proxy_response);
if (want_tls) {
want_tls = 0;

0 comments on commit c010e2e

Please sign in to comment.
You can’t perform that action at this time.