Bug 1252 - more indentation inconsistencies
more indentation inconsistencies
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
unspecified
Other All
: P5 minor
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-14 00:24 CEST by JINMEI Tatuya
Modified: 2017-04-18 11:03 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JINMEI Tatuya 2017-04-14 00:24:43 CEST
please see the diff below.  I believe it's almost obvious except
netevent.c:comm_point_create_tcp_handler(), where I also noticed inconsistency
about comment style (// vs /* */).  I guess you generally prefer the latter
consistently and changed it as such in the diff, but it's totally up to you.

Index: util/netevent.c
===================================================================
--- util/netevent.c	(revision 4124)
+++ util/netevent.c	(working copy)
@@ -666,7 +666,7 @@
 	struct comm_reply rep;
 	ssize_t rcv;
 	int i;
-    struct sldns_buffer *buffer;
+	struct sldns_buffer *buffer;
 
 	rep.c = (struct comm_point*)arg;
 	log_assert(rep.c->type == comm_udp);
@@ -704,9 +704,9 @@
 		if((*rep.c->callback)(rep.c, rep.c->cb_arg, NETEVENT_NOERROR, &rep)) {
 			/* send back immediate reply */
 #ifdef USE_DNSCRYPT
-            buffer = rep.c->dnscrypt_buffer;
+			buffer = rep.c->dnscrypt_buffer;
 #else
-            buffer = rep.c->buffer;
+			buffer = rep.c->buffer;
 #endif
 			(void)comm_point_send_udp_msg(rep.c, buffer,
 				(struct sockaddr*)&rep.addr, rep.addrlen);
@@ -725,8 +725,8 @@
 	log_assert(c->fd == -1);
 	sldns_buffer_clear(c->buffer);
 #ifdef USE_DNSCRYPT
-    if (c->dnscrypt)
-        sldns_buffer_clear(c->dnscrypt_buffer);
+	if (c->dnscrypt)
+		sldns_buffer_clear(c->dnscrypt_buffer);
 #endif
 	c->tcp_is_reading = 1;
 	c->tcp_byte_count = 0;
@@ -1525,13 +1525,13 @@
 	if(c->tcp_parent) {
 		c->dnscrypt = c->tcp_parent->dnscrypt;
 	}
-    if(c->dnscrypt && c->dnscrypt_buffer == c->buffer) {
-        c->dnscrypt_buffer = sldns_buffer_new(sldns_buffer_capacity(c->buffer));
-        if(!c->dnscrypt_buffer) {
-            log_err("Could not allocate dnscrypt buffer");
-            return;
-        }
-    }
+	if(c->dnscrypt && c->dnscrypt_buffer == c->buffer) {
+		c->dnscrypt_buffer = sldns_buffer_new(sldns_buffer_capacity(c->buffer));
+		if(!c->dnscrypt_buffer) {
+			log_err("Could not allocate dnscrypt buffer");
+			return;
+		}
+	}
 #endif
 
 	if(event&UB_EV_READ) {
@@ -1691,8 +1691,8 @@
 	c->tcp_do_close = 0;
 	c->do_not_close = 0;
 #ifdef USE_DNSCRYPT
-    c->dnscrypt = 0;
-    c->dnscrypt_buffer = buffer;
+	c->dnscrypt = 0;
+	c->dnscrypt_buffer = buffer;
 #endif
 	c->inuse = 0;
 	c->tcp_do_toggle_rw = 0;
@@ -1766,10 +1766,10 @@
 	c->tcp_do_fastopen = 0;
 #endif
 #ifdef USE_DNSCRYPT
-    c->dnscrypt = 0;
-    // We don't know just yet if this is a dnscrypt channel. Allocation
-    // will be done when handling the callback.
-    c->dnscrypt_buffer = c->buffer;
+	c->dnscrypt = 0;
+	/* We don't know just yet if this is a dnscrypt channel. Allocation
+	 * will be done when handling the callback. */
+	c->dnscrypt_buffer = c->buffer;
 #endif
 	c->repinfo.c = c;
 	c->callback = callback;
@@ -2098,11 +2098,11 @@
 	if(c->type == comm_tcp || c->type == comm_local) {
 		sldns_buffer_free(c->buffer);
 #ifdef USE_DNSCRYPT
-        if(c->dnscrypt && c->dnscrypt_buffer != c->buffer) {
-            sldns_buffer_free(c->dnscrypt_buffer);
-        }
+		if(c->dnscrypt && c->dnscrypt_buffer != c->buffer) {
+			sldns_buffer_free(c->dnscrypt_buffer);
+		}
 #endif
-    }
+	}
 	ub_event_free(c->ev->ev);
 	free(c->ev);
 	free(c);
@@ -2239,12 +2239,12 @@
 	if(c->type == comm_tcp || c->type == comm_local) {
 		s += sizeof(*c->buffer) + sldns_buffer_capacity(c->buffer);
 #ifdef USE_DNSCRYPT
-        s += sizeof(*c->dnscrypt_buffer);
-        if(c->buffer != c->dnscrypt_buffer) {
-            s += sldns_buffer_capacity(c->dnscrypt_buffer);
-        }
+		s += sizeof(*c->dnscrypt_buffer);
+		if(c->buffer != c->dnscrypt_buffer) {
+			s += sldns_buffer_capacity(c->dnscrypt_buffer);
+		}
 #endif
-    }
+	}
 	if(c->type == comm_tcp_accept) {
 		int i;
 		for(i=0; i<c->max_tcp_count; i++)
Index: util/netevent.h
===================================================================
--- util/netevent.h	(revision 4124)
+++ util/netevent.h	(working copy)
@@ -248,7 +248,7 @@
 #endif
 
 #ifdef USE_DNSCRYPT
-    /** Is this a dnscrypt channel */
+	/** Is this a dnscrypt channel */
 	int dnscrypt;
 	/** encrypted buffer pointer. Either to perthread, or own buffer or NULL */
 	struct sldns_buffer* dnscrypt_buffer;
Comment 1 Ralph Dolmans 2017-04-18 11:03:05 CEST
Thanks Jinmei!

I have applied your patch, also fixed indentation issues in other files.

Regards,
-- Ralph