chiark / gitweb /
socket-proxy: clean-up indenting
authorLennart Poettering <lennart@poettering.net>
Wed, 6 Nov 2013 17:29:24 +0000 (18:29 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 6 Nov 2013 17:29:24 +0000 (18:29 +0100)
src/socket-proxy/socket-proxyd.c

index 8f60ab88f1b754b3e681c955d5bd706c9ae5c5d9..a449b0eec42ba9d28af64c85b4f7642d4f264f5b 100644 (file)
@@ -110,11 +110,11 @@ static int remove_event_from_connection(struct connection *c, uint32_t events) {
         }
 
         if (c->events == 0) {
         }
 
         if (c->events == 0) {
-            r = sd_event_source_set_enabled(c->w, SD_EVENT_OFF);
-            if (r < 0) {
-                    log_error("Error %d disabling source: %s", r, strerror(-r));
-                    return r;
-            }
+                r = sd_event_source_set_enabled(c->w, SD_EVENT_OFF);
+                if (r < 0) {
+                        log_error("Error %d disabling source: %s", r, strerror(-r));
+                        return r;
+                }
         }
 
         return 0;
         }
 
         return 0;
@@ -155,11 +155,11 @@ static int send_buffer(struct connection *sender) {
 
                 /* If the buffer is full, disable events coming for recv. */
                 if (sender->buffer_filled_len == BUFFER_SIZE) {
 
                 /* If the buffer is full, disable events coming for recv. */
                 if (sender->buffer_filled_len == BUFFER_SIZE) {
-                    r = remove_event_from_connection(sender, EPOLLIN);
-                    if (r < 0) {
-                            log_error("Error %d disabling EPOLLIN for fd=%d: %s", r, sender->fd, strerror(-r));
-                            return r;
-                    }
+                        r = remove_event_from_connection(sender, EPOLLIN);
+                        if (r < 0) {
+                                log_error("Error %d disabling EPOLLIN for fd=%d: %s", r, sender->fd, strerror(-r));
+                                return r;
+                        }
                 }
 
                 /* Watch for when the recipient can be sent data again. */
                 }
 
                 /* Watch for when the recipient can be sent data again. */
@@ -218,8 +218,7 @@ static int transfer_data_cb(sd_event_source *s, int fd, uint32_t revents, void *
                                 if (errno != EWOULDBLOCK && errno != EAGAIN) {
                                         log_error("Error %d in recv from fd=%d: %m", errno, fd);
                                         return -errno;
                                 if (errno != EWOULDBLOCK && errno != EAGAIN) {
                                         log_error("Error %d in recv from fd=%d: %m", errno, fd);
                                         return -errno;
-                                }
-                                else {
+                                } else {
                                         /* recv() is in a blocking state. */
                                         break;
                                 }
                                         /* recv() is in a blocking state. */
                                         break;
                                 }
@@ -280,7 +279,7 @@ static int connected_to_server_cb(sd_event_source *s, int fd, uint32_t revents,
         }
         c_client_to_server->events = EPOLLIN;
 
         }
         c_client_to_server->events = EPOLLIN;
 
-goto finish;
+        goto finish;
 
 fail:
         free_connection(c_client_to_server);
 
 fail:
         free_connection(c_client_to_server);