[stsf-commit] stsf/STFontServer/src fontserver.c, 1.3, 1.4 handler.c, 1.4, 1.5 stfs-door.c, 1.5, 1.6

Alexander Gelfenbain stsf-commit at pdx.freedesktop.org
Tue May 25 14:08:23 PDT 2004


Committed by: adg


Index: fontserver.c
===================================================================
RCS file: /cvs/stsf/stsf/STFontServer/src/fontserver.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- a/fontserver.c	9 Apr 2004 03:08:28 -0000	1.3
+++ b/fontserver.c	25 May 2004 21:08:21 -0000	1.4
@@ -2109,18 +2109,18 @@
     OpaqueFontServer *ofs = (OpaqueFontServer *) fs;
     intptr_t ret = 0;
 
-    DebugStr(1, "%s: A", __func__);
+    DebugStr(6, "%s: A", __func__);
     pthread_mutex_lock(&ofs->c_lock);
     do {
         nextkey++;
     } while (dictFindKey(ofs->clients, nextkey));
-    DebugStr(1, "%s: B", __func__);
+    DebugStr(6, "%s: B", __func__);
     
     if (dictInsert(ofs->clients, nextkey, cdata) == 1) {
         ret = nextkey;
     }
     pthread_mutex_unlock(&ofs->c_lock);
-    DebugStr(1, "%s: C", __func__);
+    DebugStr(6, "%s: C", __func__);
 
 
     return ret;

Index: handler.c
===================================================================
RCS file: /cvs/stsf/stsf/STFontServer/src/handler.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- a/handler.c	25 May 2004 02:47:24 -0000	1.4
+++ b/handler.c	25 May 2004 21:08:21 -0000	1.5
@@ -142,7 +142,7 @@
 
         case FS_CLOSE_IN:
             {
-                DebugStr(1, "stfontserverd: (thread: %d) received STFS_CLOSE. Shutting down the connection.", pthread_self());
+                DebugStr(1, "stfontserverd: (thread: %d) received FS_CLOSE_IN.", pthread_self());
                 if ((n = ci_close_out(p, s)) != 0) {
                     return ST_PROTO_BUFF;
                 }

Index: stfs-door.c
===================================================================
RCS file: /cvs/stsf/stsf/STFontServer/src/stfs-door.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- a/stfs-door.c	25 May 2004 02:47:24 -0000	1.5
+++ b/stfs-door.c	25 May 2004 21:08:21 -0000	1.6
@@ -257,10 +257,10 @@
         ro.cid = -1;
         ro.ret = ST_INTERNAL_ERROR;
         if (door_return((char *) &ro, sizeof ro, NULL, 0) == -1) {
-            perror("door_return");
+            perror("door_return: 1");
             if (errno == E2BIG) {
                 if (door_return(NULL, 0, NULL, 0) == -1) {
-                    perror("door_return");
+                    perror("door_return: 2");
                 }
             }
             return;
@@ -284,7 +284,7 @@
                 DebugStr(8, "%s: G", __func__);
             }
             FSDeleteClient(fs, ckey);
-            DebugStr(1,"%s: decrementing nthr[A]: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
+            DebugStr(4,"%s: decrementing nthr[A]: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
             DebugStr(8, "%s: H", __func__);
             pthread_mutex_unlock(&fsc->lock);
             DebugStr(8, "%s: I", __func__);
@@ -294,7 +294,7 @@
         
         if (door_return(NULL, 0, NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [B] len: 0", __func__);
-            perror("door_return");
+            perror("door_return: 3");
             return;
         }
     }
@@ -303,7 +303,7 @@
     pthread_mutex_lock(&fsc->lock);
     DebugStr(8, "%s: pthread: %d B", __func__, pthread_self());
     fsc->nthr++;
-    DebugStr(1,"%s: incrementing nthr: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
+    DebugStr(4,"%s: incrementing nthr: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
     pthread_mutex_unlock(&fsc->lock);
     DebugStr(8, "%s: pthread: %d C", __func__, pthread_self());
     
@@ -329,6 +329,7 @@
                 ro.x.c.memsize = fsc->shmlen;
                 fsc->state = VERIFY;
                 ret_ndesc = 1;
+                desc.d_attributes = DOOR_DESCRIPTOR;
                 desc.d_data.d_desc.d_descriptor = fsc->shmfd;
                 pdesc = &desc;
                 fsc->psize = ri->x.c.payloadsize;
@@ -362,20 +363,20 @@
                                          (byte *) fsc->shmaddr + hdr->proto_offset, hdr->proto_size);
 
                 if (ro.x.p.opcode == FS_CLOSE_OUT) {
-                    DebugStr(1, "%s: deallocating the client after receiving HR_CLOSE, nthr: %d", __func__, fsc->nthr);
+                    DebugStr(1, "%s: deallocating the client after receiving FS_CLOSE, nthr: %d", __func__, fsc->nthr);
                     // close(fsc->fd);             /* Close the client's door */
 
-                    DebugStr(1, "%s: [D1] nthr: %d", __func__, fsc->nthr); 
+                    DebugStr(4, "%s: [D1] nthr: %d", __func__, fsc->nthr); 
                     
                     pthread_mutex_lock(&fsc->lock);
                     while (fsc->nthr > 1) {
                         pthread_cond_wait(&fsc->cond, &fsc->lock);
                     }
-                    DebugStr(1, "%s: [D2] nthr: %d", __func__, fsc->nthr); 
+                    DebugStr(4, "%s: [D2] nthr: %d", __func__, fsc->nthr); 
                     FSDeleteClient(fs, ckey);
                     fsc->nthr--;
-                    DebugStr(1, "%s: [D3] nthr: %d", __func__, fsc->nthr); 
-                    DebugStr(1,"%s: decrementing nthr[C]: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
+                    DebugStr(4, "%s: [D3] nthr: %d", __func__, fsc->nthr); 
+                    DebugStr(4,"%s: decrementing nthr[C]: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
                     pthread_mutex_unlock(&fsc->lock);
 
                     fsclient_destroy(fsc);
@@ -392,7 +393,7 @@
     pthread_mutex_lock(&fsc->lock);
     DebugStr(8, "%s: O", __func__);
     fsc->nthr--;
-    DebugStr(1,"%s: decrementing nthr[D]: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
+    DebugStr(4,"%s: decrementing nthr[D]: pthread: %d, nthr: %d, ckey: %d.", __func__, pthread_self(), fsc->nthr, ckey);
     pthread_mutex_unlock(&fsc->lock);
     DebugStr(8, "%s: P", __func__);
     pthread_cond_signal(&fsc->cond);
@@ -401,7 +402,9 @@
 doorret:
 
     if (door_return((char*) &ro, sizeof ro, pdesc, ret_ndesc) == -1) {
-        perror("door_return");
+//    if (door_return((char*) &ro, sizeof ro, NULL, 0) == -1) {
+        perror("door_return: 4");
+        ErrorStr("ri->state: %d, ret_ndesc: %d", ri->state, ret_ndesc);
     }
 }
 
@@ -433,7 +436,7 @@
     if (argp == DOOR_UNREF_DATA) {
         if (door_return(NULL, 0, NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [A], len: 0", __func__);
-            perror("door_return");
+            perror("door_return: 5");
             return;
         }
     }
@@ -442,7 +445,7 @@
         out.ret = ST_PROTO_ERROR;
         if (door_return((char *) &out, sizeof(DoorHandshakeOut), NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [B], len: %d", __func__, sizeof(DoorHandshakeOut));
-            perror("door_return");
+            perror("door_return: 6");
             return;
         }
     }
@@ -458,7 +461,7 @@
         out.ret = ST_PROTO_ERROR;
         if (door_return((char *) &out, sizeof(DoorHandshakeOut), NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [C], len: %d", __func__, sizeof(DoorHandshakeOut));
-            perror("door_return");
+            perror("door_return: 7");
             return;
         }
 
@@ -470,7 +473,7 @@
         out.opcode = HANDSHAKE_VERIFY_REPLY;
         if (door_return((char *) &out, sizeof(DoorHandshakeOut), NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [C], len: %d", __func__, sizeof(DoorHandshakeOut));
-            perror("door_return");
+            perror("door_return: 8");
             return;
         }
 
@@ -480,7 +483,7 @@
         out.ret = ST_INTERNAL_ERROR;
         if (door_return((char *) &out, sizeof(DoorHandshakeOut), NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [D], len: %d", __func__, sizeof(DoorHandshakeOut));
-            perror("door_return");
+            perror("door_return: 9");
             return;
         }
 
@@ -495,7 +498,7 @@
         fsclient_destroy(fsc);
         if (door_return((char *) &out, sizeof(DoorHandshakeOut), NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [E], len: %d", __func__, sizeof(DoorHandshakeOut));
-            perror("door_return");
+            perror("door_return: 10");
             return;
         }
 
@@ -512,7 +515,7 @@
         fsclient_destroy(fsc);
         if (door_return((char *) &out, sizeof(DoorHandshakeOut), NULL, 0) == -1) {
             DebugStr(1, "%s: door_return() returned -1 [B], len: %d", __func__, sizeof(DoorHandshakeOut));
-            perror("door_return");
+            perror("door_return: 11");
             return;
         }
 
@@ -527,7 +530,7 @@
 
     if (door_return((char *) &out, sizeof(DoorHandshakeOut), &desc, 1) == -1) {
         DebugStr(1, "%s: door_return() returned -1 [B], len: %d", __func__, sizeof(DoorHandshakeOut));
-        perror("door_return");
+        perror("door_return: 12");
     }
 
 }




More information about the stsf-commit mailing list