]> arthur.barton.de Git - netatalk.git/commitdiff
remove obsolete DSI #ifdef DEBUG1 code
authordidg <didg>
Thu, 22 Oct 2009 05:09:56 +0000 (05:09 +0000)
committerdidg <didg>
Thu, 22 Oct 2009 05:09:56 +0000 (05:09 +0000)
etc/afpd/afp_dsi.c
etc/afpd/desktop.c
etc/afpd/fork.c

index 7c856d47dc155d01e186bf0f79e959bd4fc353d1..b66dafc9b69dad64567159af868528a7497c24aa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_dsi.c,v 1.41 2009-10-21 07:03:08 didg Exp $
+ * $Id: afp_dsi.c,v 1.42 2009-10-22 05:09:56 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -203,24 +203,6 @@ static void alarm_handler(int sig _U_)
     }
 }
 
-
-#ifdef DEBUG1
-/*  ---------------------------------
- *  old signal handler for SIGUSR1 - set the debug flag and 
- *  redirect stdout to <tmpdir>/afpd-debug-<pid>.
- */
-void afp_set_debug (int sig)
-{
-    char       fname[MAXPATHLEN];
-
-    snprintf(fname, MAXPATHLEN-1, "%safpd-debug-%d", P_tmpdir, getpid());
-    freopen(fname, "w", stdout);
-    child.obj->options.flags |= OPTION_DEBUG;
-
-    return;
-}
-#endif
-
 /* -------------------------------------------
  afp over dsi. this never returns. 
 */
@@ -319,10 +301,6 @@ void afp_over_dsi(AFPObj *obj)
     }
 #endif /* DEBUGGING */
 
-#ifdef DEBUG1
-    fault_setup((void (*)(void *))afp_dsi_die);
-#endif
-
     /* get stuck here until the end */
     while ((cmd = dsi_receive(dsi))) {
         child.tickle = 0;
@@ -344,10 +322,6 @@ void afp_over_dsi(AFPObj *obj)
         case DSIFUNC_CLOSE:
             afp_dsi_close(obj);
             LOG(log_info, logtype_afpd, "done");
-#ifdef DEBUG1
-            if (obj->options.flags & OPTION_DEBUG )
-                printf("done\n");
-#endif                
             return;
             break;
 
@@ -362,12 +336,6 @@ void afp_over_dsi(AFPObj *obj)
 #endif /* AFS */
 
             function = (u_char) dsi->commands[0];
-#ifdef DEBUG1
-            if (obj->options.flags & OPTION_DEBUG ) {
-                printf("command: %d (%s)\n", function, AfpNum2name(function));
-                bprint((char *) dsi->commands, dsi->cmdlen);
-            }
-#endif            
 
             /* send off an afp command. in a couple cases, we take advantage
              * of the fact that we're a stream-based protocol. */
@@ -401,12 +369,6 @@ void afp_over_dsi(AFPObj *obj)
                 break;
             }
 
-#ifdef DEBUG1
-            if (obj->options.flags & OPTION_DEBUG ) {
-                printf( "reply: %d, %d\n", err, dsi->clientID);
-                bprint((char *) dsi->data, dsi->datalen);
-            }
-#endif
             if (!dsi_cmdreply(dsi, err)) {
                 LOG(log_error, logtype_afpd, "dsi_cmdreply(%d): %s", dsi->socket, strerror(errno) );
                 afp_dsi_die(EXITERR_CLNT);
@@ -415,12 +377,6 @@ void afp_over_dsi(AFPObj *obj)
 
         case DSIFUNC_WRITE: /* FPWrite and FPAddIcon */
             function = (u_char) dsi->commands[0];
-#ifdef DEBUG1
-            if ( obj->options.flags & OPTION_DEBUG ) {
-                printf("(write) command: %d, %d\n", function, dsi->cmdlen);
-                bprint((char *) dsi->commands, dsi->cmdlen);
-            }
-#endif
             if ( afp_switch[ function ] != NULL ) {
                 dsi->datalen = DSI_DATASIZ;
                 child.flags |= CHILD_RUNNING;
@@ -438,12 +394,6 @@ void afp_over_dsi(AFPObj *obj)
                 err = AFPERR_NOOP;
             }
 
-#ifdef DEBUG1
-            if (obj->options.flags & OPTION_DEBUG ) {
-                printf( "(write) reply code: %d, %d\n", err, dsi->clientID);
-                bprint((char *) dsi->data, dsi->datalen);
-            }
-#endif
             if (!dsi_wrtreply(dsi, err)) {
                 LOG(log_error, logtype_afpd, "dsi_wrtreply: %s", strerror(errno) );
                 afp_dsi_die(EXITERR_CLNT);
@@ -463,15 +413,6 @@ void afp_over_dsi(AFPObj *obj)
             dsi_writeflush(dsi);
             break;
         }
-#ifdef DEBUG1
-        if ( obj->options.flags & OPTION_DEBUG ) {
-#ifdef notdef
-            pdesc( stdout );
-#endif /* notdef */
-            of_pforkdesc( stdout );
-            fflush( stdout );
-        }
-#endif
     }
 
     /* error */
index b1f0c9cc6961d92f2cee77ec2618f531d9aeddb2..8acce125e2e7c08048d0ef39bf7729834ac1658d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: desktop.c,v 1.40 2009-10-15 10:43:13 didg Exp $
+ * $Id: desktop.c,v 1.41 2009-10-22 05:09:56 didg Exp $
  *
  * See COPYRIGHT.
  *
@@ -278,12 +278,6 @@ addicon_err:
             }
 
             while ((iovcnt = dsi_write(dsi, rbuf, buflen))) {
-#ifdef DEBUG1
-                if ( obj->options.flags & OPTION_DEBUG ) {
-                    printf("(write) command cont'd: %d\n", iovcnt);
-                    bprint(rbuf, iovcnt);
-                }
-#endif
                 if ((cc = write(si.sdt_fd, rbuf, iovcnt)) < 0) {
                     LOG(log_error, logtype_afpd, "afp_addicon(%s): write: %s", icon_dtfile(vol, fcreator), strerror(errno));
                     dsi_writeflush(dsi);
@@ -528,12 +522,6 @@ int afp_geticon(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
             if (buflen < 0)
                 goto geticon_exit;
 
-#ifdef DEBUG1
-            if (obj->options.flags & OPTION_DEBUG) {
-                printf( "(read) reply: %d, %d\n", buflen, dsi->clientID);
-                bprint(rbuf, buflen);
-            }
-#endif
             /* dsi_read() also returns buffer size of next allocation */
             buflen = dsi_read(dsi, rbuf, buflen); /* send it off */
             if (buflen < 0)
index f7d27826da01eeda01ebcb0d0269ae196dce0858..611dc8f9819f4da607c8f1fabaddc61c31d794f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: fork.c,v 1.65 2009-10-15 10:43:13 didg Exp $
+ * $Id: fork.c,v 1.66 2009-10-22 05:09:56 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -912,12 +912,6 @@ static int read_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, si
         off_t  size;
         int    non_blocking = 0;
 
-#ifdef DEBUG1
-        if (obj->options.flags & OPTION_DEBUG) {
-            printf( "(read) reply: %d/%d, %d\n", *rbuflen,(int) reqcount, dsi->clientID);
-            bprint(rbuf, *rbuflen);
-        }
-#endif        
         /* reqcount isn't always truthful. we need to deal with that. */
         size = ad_size(ofork->of_ad, eid);
 
@@ -1331,12 +1325,6 @@ static int write_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, s
             /* loop until everything gets written. currently
                     * dsi_write handles the end case by itself. */
             while ((cc = dsi_write(dsi, rbuf, *rbuflen))) {
-#ifdef DEBUG1
-                if ( obj->options.flags & OPTION_DEBUG ) {
-                    printf("(write) command cont'd: %d\n", cc);
-                    bprint(rbuf, cc);
-                }
-#endif
                 if ((cc = write_file(ofork, eid, offset, rbuf, cc, xlate)) < 0) {
                     dsi_writeflush(dsi);
                     *rbuflen = 0;