-dnl $Id: configure.in,v 1.179.2.3.2.2 2003-09-09 18:18:53 bfernhomberg Exp $
+dnl $Id: configure.in,v 1.179.2.3.2.3 2003-09-12 18:44:16 didg Exp $
dnl configure.in for netatalk
AC_INIT(bin/adv1tov2/adv1tov2.c)
fi
)
-AC_ARG_ENABLE(debug,
- [ --enable-debug enable debug code],
+AC_ARG_ENABLE(debug1,
+ [ --enable-debug1 enable debug code],
if test "$enableval" != "no"; then
if test "$enableval" = "yes"; then
- AC_DEFINE(DEBUG, 1, [Define if debugging information should be included])
+ AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included])
else
- AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if debugging information should be included])
+ AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included])
fi
AC_MSG_RESULT([enabling debugging code])
fi
)
+AC_ARG_ENABLE(debug,
+ [ --enable-debug enable verbose debug code],
+ if test "$enableval" != "no"; then
+ if test "$enableval" = "yes"; then
+ AC_DEFINE(DEBUG, 1, [Define if verbose debugging information should be included])
+ else
+ AC_DEFINE_UNQUOTED(DEBUG, $enableval, [Define if verbose debugging information should be included])
+ fi
+ AC_MSG_RESULT([enabling verbose debugging code])
+ fi
+)
+
afp3=no
AC_ARG_ENABLE(afp3,
[ --enable-afp3 enable AFP 3.x calls],
/*
- * $Id: afp_asp.c,v 1.18.6.1 2003-09-09 16:42:19 didg Exp $
+ * $Id: afp_asp.c,v 1.18.6.2 2003-09-12 18:44:16 didg Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
afp_asp_close(obj);
LOG(log_info, logtype_afpd, "done" );
+#ifdef DEBUG1
if ( obj->options.flags & OPTION_DEBUG ) {
printf( "done\n" );
}
+#endif
return;
break;
}
#endif /* AFS */
func = (u_char) asp->commands[0];
+#ifdef DEBUG1
if ( obj->options.flags & OPTION_DEBUG ) {
printf("command: %d (%s)\n", func, AfpNum2name(func));
bprint( asp->commands, asp->cmdlen );
}
+#endif
if ( afp_switch[ func ] != NULL ) {
/*
* The function called from afp_switch is expected to
asp->datalen = 0;
reply = AFPERR_NOOP;
}
+#ifdef DEBUG1
if ( obj->options.flags & OPTION_DEBUG ) {
printf( "reply: %d, %d\n", reply, ccnt++ );
bprint( asp->data, asp->datalen );
}
-
+#endif
if ( asp_cmdreply( asp, reply ) < 0 ) {
LOG(log_error, logtype_afpd, "asp_cmdreply: %s", strerror(errno) );
afp_asp_die(1);
case ASPFUNC_WRITE :
func = (u_char) asp->commands[0];
+#ifdef DEBUG1
if ( obj->options.flags & OPTION_DEBUG ) {
printf( "(write) command: %d\n", func );
bprint( asp->commands, asp->cmdlen );
}
+#endif
if ( afp_switch[ func ] != NULL ) {
asp->datalen = ASP_DATASIZ;
reply = (*afp_switch[ func ])(obj,
asp->datalen = 0;
reply = AFPERR_NOOP;
}
+#ifdef DEBUG1
if ( obj->options.flags & OPTION_DEBUG ) {
printf( "(write) reply code: %d, %d\n", reply, ccnt++ );
bprint( asp->data, asp->datalen );
}
+#endif
if ( asp_wrtreply( asp, reply ) < 0 ) {
LOG(log_error, logtype_afpd, "asp_wrtreply: %s", strerror(errno) );
afp_asp_die(1);
LOG(log_info, logtype_afpd, "main: asp_getrequest: %d", reply );
break;
}
-
+#ifdef DEBUG1
if ( obj->options.flags & OPTION_DEBUG ) {
#ifdef notdef
pdesc( stdout );
of_pforkdesc( stdout );
fflush( stdout );
}
+#endif
}
}
/*
- * $Id: afp_dsi.c,v 1.27.2.3.2.1 2003-09-09 16:42:19 didg Exp $
+ * $Id: afp_dsi.c,v 1.27.2.3.2.2 2003-09-12 18:44:17 didg Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
}
+#ifdef DEBUG1
/* ---------------------------------
* old signal handler for SIGUSR1 - set the debug flag and
* redirect stdout to <tmpdir>/afpd-debug-<pid>.
return;
}
+#endif
/* -------------------------------------------
afp over dsi. this never returns.
afp_dsi_die(1);
}
+#ifdef DEBUG1
fault_setup((void (*)(void *))afp_dsi_die);
+#endif
/* get stuck here until the end */
while ((cmd = dsi_receive(dsi))) {
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;
#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. */
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(1);
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;
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(1);
dsi_writeflush(dsi);
break;
}
-
+#ifdef DEBUG1
if ( obj->options.flags & OPTION_DEBUG ) {
#ifdef notdef
pdesc( stdout );
of_pforkdesc( stdout );
fflush( stdout );
}
+#endif
}
/* error */
/*
- * $Id: desktop.c,v 1.26.2.4.2.2 2003-09-11 23:36:44 bfernhomberg Exp $
+ * $Id: desktop.c,v 1.26.2.4.2.3 2003-09-12 18:44:17 didg Exp $
*
* See COPYRIGHT.
*
if ((asp_wrtcont(obj->handle, rbuf, &buflen) < 0) || buflen != bsize)
return( AFPERR_PARAM );
+#ifdef DEBUG1
if (obj->options.flags & OPTION_DEBUG) {
printf("(write) len: %d\n", buflen);
bprint(rbuf, buflen);
}
+#endif
/*
* We're at the end of the file, add the headers, etc. */
}
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: write: %s", strerror(errno));
dsi_writeflush(dsi);
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)
/*
- * $Id: fork.c,v 1.51.2.2.2.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: fork.c,v 1.51.2.2.2.2 2003-09-12 18:44:17 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
if ((obj->proto == AFPPROTO_DSI) && (*rbuflen < reqcount) && !nlmask) {
DSI *dsi = obj->handle;
+#ifdef DEBUG1
if (obj->options.flags & OPTION_DEBUG) {
printf( "(read) reply: %d/%d, %d\n", *rbuflen,
(int) reqcount, dsi->clientID);
bprint(rbuf, *rbuflen);
}
+#endif
/* subtract off the offset */
size -= offset;
if (reqcount > size) {
goto afp_read_exit;
offset += *rbuflen;
+#ifdef DEBUG1
if (obj->options.flags & OPTION_DEBUG) {
printf( "(read) reply: %d, %d\n", *rbuflen, dsi->clientID);
bprint(rbuf, *rbuflen);
}
-
+#endif
/* dsi_read() also returns buffer size of next allocation */
cc = dsi_read(dsi, rbuf, *rbuflen); /* send it off */
if (cc < 0)
return( AFPERR_PARAM );
}
+#ifdef DEBUG1
if (obj->options.flags & OPTION_DEBUG) {
printf("(write) len: %d\n", *rbuflen);
bprint(rbuf, *rbuflen);
}
-
+#endif
if ((cc = write_file(ofork, eid, offset, rbuf, *rbuflen,
xlate)) < 0) {
*rbuflen = 0;
/* 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;
/*
- * $Id: main.c,v 1.20.4.2.2.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: main.c,v 1.20.4.2.2.2 2003-09-12 18:44:17 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
argv = av;
set_auth_parameters( ac, av );
#endif /* TRU64 */
- fault_setup(NULL);
+#ifdef DEBUG1
+ fault_setup(NULL);
+#endif
afp_options_init(&default_options);
if (!afp_options_parse(ac, av, &default_options))
exit(1);
#include "config.h"
#endif
+#ifdef DEBUG1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
printf("(end)\n");
}
+#endif
#include "config.h"
#endif
+#ifdef DEBUG1
+
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
}
-
-
+#endif