Simplified conditions.
authorJiří Filipovič <fila@ics.muni.cz>
Fri, 3 Jul 2009 14:43:44 +0000 (14:43 +0000)
committerJiří Filipovič <fila@ics.muni.cz>
Fri, 3 Jul 2009 14:43:44 +0000 (14:43 +0000)
org.glite.lb.server/src/bkserverd.c

index e06dd1d..c28dde2 100644 (file)
@@ -1412,24 +1412,21 @@ int bk_accept_serve(int conn, struct timeval *timeout, void *cdata)
        memcpy(&ctx->p_tmp_timeout, timeout, sizeof(ctx->p_tmp_timeout));
        gettimeofday(&before, NULL);
        err = edg_wll_AcceptHTTP(ctx, &body, &resp, &hdrOut, &bodyOut, &httpErr);
-       if (httpErr != HTTP_BADREQ){
-               if (err && (err = handle_server_error(ctx))){
-                       edg_wll_DoneHTTP(ctx, resp, hdrOut, bodyOut);
-                       free(resp);
-                       free(bodyOut);
-                        if (body)
-                               free(body);
-                       // hdrOut are static
-                       return err;
-               }
+       if (err && (err = handle_server_error(ctx))){
+               edg_wll_DoneHTTP(ctx, resp, hdrOut, bodyOut);
+               free(resp);
+               free(bodyOut);
+                if (body)
+                       free(body);
+               // hdrOut are static
+               return err;
        }
 
-       err = 0;
 #ifdef GLITE_LB_SERVER_WITH_WS
        if (httpErr == HTTP_BADREQ)
                err = try_accept_ws(conn, timeout, cdata, body, strlen(body) + 1);
 #endif
-       if (!err)
+       if (err)
                edg_wll_DoneHTTP(ctx, resp, hdrOut, bodyOut);
 
        free(resp);