trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bc...@apache.org
Subject [trafficserver] 01/02: Revert "Fix post_error test by initializating the address length of the accept call."
Date Mon, 16 Jul 2018 14:48:11 GMT
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 9ef7d1ec9df8b50e19e56b7f5b357a608815e3b7
Author: Bryan Call <bcall@apache.org>
AuthorDate: Thu Jul 12 15:28:43 2018 -0700

    Revert "Fix post_error test by initializating the address length of the accept call."
    
    This reverts commit 9b3a8a2d1faf291cdfa3ad1cea46c0a75d7fd7b6.
---
 tests/gold_tests/post_error/post_server.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/tests/gold_tests/post_error/post_server.c b/tests/gold_tests/post_error/post_server.c
index cb4976f..bff4889 100644
--- a/tests/gold_tests/post_error/post_server.c
+++ b/tests/gold_tests/post_error/post_server.c
@@ -41,27 +41,18 @@ main(int argc, char *argv[])
   printf("Starting...\n");
 
   int listenfd = socket(AF_INET, SOCK_STREAM, 0);
-
-  int optval = 1;
-  setsockopt(listenfd, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval));
-
   struct sockaddr_in serv_addr, peer_addr;
   socklen_t peer_len;
+
   serv_addr.sin_family      = AF_INET;
   serv_addr.sin_addr.s_addr = INADDR_ANY;
   int port                  = atoi(argv[1]);
   serv_addr.sin_port        = htons(port);
-  if (bind(listenfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
-    perror("bind failed");
-    exit(1);
-  }
-  if (listen(listenfd, 10) < 0) {
-    perror("listen failed");
-    exit(1);
-  }
+  bind(listenfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr));
+  listen(listenfd, 10);
 
   for (;;) {
-    socklen_t client_len = sizeof(struct sockaddr_in);
+    socklen_t client_len;
     struct sockaddr_in client;
     int client_sock = accept(listenfd, reinterpret_cast<struct sockaddr *>(&client),
&client_len);
     if (client_sock < 0) {


Mime
View raw message