== Frameserver ==
authorPeter Schlaile <peter@schlaile.de>
Mon, 26 Jun 2006 13:22:55 +0000 (13:22 +0000)
committerPeter Schlaile <peter@schlaile.de>
Mon, 26 Jun 2006 13:22:55 +0000 (13:22 +0000)
Set SO_REUSEADDR on server-socket, since otherwise, frameserver will barf on
second start.

source/blender/blenkernel/intern/writeframeserver.c
source/blender/render/intern/source/convertblender.c

index 58d8f82d45434029b8906b016a671ce60d0a2ba1..76832922dcfe810243f2535ddfe0776144059178 100644 (file)
@@ -28,6 +28,7 @@
 #else
 #include <sys/time.h>
 #include <sys/socket.h>
+#include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <net/if.h>
@@ -90,6 +91,7 @@ static int closesocket(int fd) {
 void start_frameserver(RenderData *rd, int rectx, int recty)
 {
         struct sockaddr_in      addr;
+       int arg = 1;
 
        if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
                G.afbreek = 1; /* Abort render */
@@ -97,6 +99,9 @@ void start_frameserver(RenderData *rd, int rectx, int recty)
                return;
         }
 
+       setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+                   (char*) &arg, sizeof(arg));
+
        addr.sin_family = AF_INET;
         addr.sin_port = htons(U.frameserverport);
         addr.sin_addr.s_addr = INADDR_ANY;
index 2596eb84b15fe567af9f08d2ae198a2ca6ae50dc..c7b96ad28f3bc44981e31f49d0b7db5929038cfe 100644 (file)
@@ -604,7 +604,7 @@ static void calc_vertexnormals(Render *re, int startvert, int startvlak, int do_
                        float *v1= vlr->v1->n;
                        float *v2= vlr->v2->n;
                        float *v3= vlr->v3->n;
-                       float *v4= vlr->v4->n;
+                       float *v4= vlr->v4?vlr->v4->n:NULL;
                        float *nor= vlr->n;
                        vlr->puno &= ~15;
                        if ((nor[0]*v1[0] + nor[1]*v1[1] + nor[2]*v1[2]) < -FLT_EPSILON10) vlr->puno= 1;