Index: jabber-1.4/configure
diff -c jabber-1.4/configure:1.1 jabber-1.4/configure:1.3
*** jabber-1.4/configure:1.1	Tue Feb 13 13:23:54 2001
--- jabber-1.4/configure	Mon Feb 26 15:12:55 2001
***************
*** 19,24 ****
--- 19,25 ----
          WANT_SSL=1;;
      esac;
  done;
+ 
  ##
  # Setup our initial flags
  ##
***************
*** 27,38 ****
  else
      CC="gcc";
  fi;
! CFLAGS="$CFLAGS -g -Wall -fPIC -I. -I.."
! MCFLAGS="$MCFLAGS -shared"
  LDFLAGS="$LDFLAGS"
  LIBS="$LIBS"
  XLDFLAGS="$XLDFLAGS "
! JHOME=`pwd`
  
  ##
  # Print a cool header
--- 28,48 ----
  else
      CC="gcc";
  fi;
! 
! if [ "$CC" = "gcc" ]; then
!   CFLAGS="$CFLAGS -g -Wall -fPIC -I. -I.."
!   MCFLAGS="$MCFLAGS -shared"
! else
!   CFLAGS="$CFLAGS -I. -I.."
!   MCFLAGS="$MCFLAGS"
! fi
! 
  LDFLAGS="$LDFLAGS"
  LIBS="$LIBS"
  XLDFLAGS="$XLDFLAGS "
! # Set JHOME to `pwd` only if not already set
! [ ! -n "$JHOME" ] && JHOME=`pwd`
! 
  
  ##
  # Print a cool header
***************
*** 127,141 ****
          XLDFLAGS="$XLDFLAGS -Wl,-E";;
      AIX)
          # create an export file for AIX:
! cat <<EOF >jabberd/jabberd.exp
  #!
  _mio_xml_parser
  _pool_new
  _pool_new_heap
  EOF
! CFLAGS="$CFLAGS -DMAXDNAME=1025"
! MCFLAGS="$MCFLAGS -Wl,-G"
! XLDFLAGS="$XLDFLAGS -Wl,-brtl,-bexpall,-bE:jabberd.exp";;
  
  esac
  printf "     Done.\n"
--- 137,150 ----
          XLDFLAGS="$XLDFLAGS -Wl,-E";;
      AIX)
          # create an export file for AIX:
! 	cat <<EOF >jabberd/jabberd.exp
  #!
  _mio_xml_parser
  _pool_new
  _pool_new_heap
  EOF
! 	MCFLAGS="$MCFLAGS -Wl,-G,-bexpall"
! 	XLDFLAGS="$XLDFLAGS -Wl,-brtl,-bexpall,-bE:jabberd.exp";;
  
  esac
  printf "     Done.\n"
Index: jabber-1.4/jabberd/lib/lib.h
diff -c jabber-1.4/jabberd/lib/lib.h:1.1 jabber-1.4/jabberd/lib/lib.h:1.3
*** jabber-1.4/jabberd/lib/lib.h:1.1	Tue Feb 13 13:23:55 2001
--- jabber-1.4/jabberd/lib/lib.h	Mon Feb 26 15:13:05 2001
***************
*** 15,20 ****
--- 15,24 ----
  #include <netinet/in.h>
  #include <netdb.h>
  #include <arpa/inet.h>
+ #ifdef _AIX
+ #include <time.h>
+ #include <arpa/nameser.h>
+ #endif
  #include <resolv.h>
  #include <sys/time.h>
  #include <stdarg.h>
***************
*** 546,553 ****
  int jlimit_check(jlimit r, char *key, int points);
  
  
! // #define KARMA_DEBUG
! // default to disable karma 
  #define KARMA_READ_MAX(k) (k*100) /* how much you are allowed to read off the sock */
  #define KARMA_INIT -100   /* internal "init" value, should not be able to get here */
  #define KARMA_HEARTBEAT 2 /* seconds to register for heartbeat */
--- 550,557 ----
  int jlimit_check(jlimit r, char *key, int points);
  
  
! /* #define KARMA_DEBUG */
! /* default to disable karma */
  #define KARMA_READ_MAX(k) (k*100) /* how much you are allowed to read off the sock */
  #define KARMA_INIT -100   /* internal "init" value, should not be able to get here */
  #define KARMA_HEARTBEAT 2 /* seconds to register for heartbeat */
***************
*** 586,591 ****
--- 590,596 ----
      char msg[64];
  } terror;
  
+ #ifndef _AIX
  #define TERROR_BAD           (terror){400,"Bad Request"}
  #define TERROR_AUTH          (terror){401,"Unauthorized"}
  #define TERROR_PAY           (terror){402,"Payment Required"}
***************
*** 603,608 ****
--- 608,635 ----
  #define TERROR_UNAVAIL    (terror){503,"Service Unavailable"}
  #define TERROR_EXTTIMEOUT (terror){504,"Remote Server Timeout"}
  #define TERROR_DISCONNECTED (terror){510,"Disconnected"}
+ #else
+ static terror TERROR_BAD =         {400,"Bad Request"};
+ static terror TERROR_AUTH =        {401,"Unauthorized"};
+ static terror TERROR_PAY =         {402,"Payment Required"};
+ static terror TERROR_FORBIDDEN =   {403,"Forbidden"};
+ static terror TERROR_NOTFOUND  =   {404,"Not Found"};
+ static terror TERROR_NOTALLOWED =  {405,"Not Allowed"};
+ static terror TERROR_NOTACCEPTABLE = {406,"Not Acceptable"};
+ static terror TERROR_REGISTER =    {407,"Registration Required"};
+ static terror TERROR_REQTIMEOUT =  {408,"Request Timeout"};
+ static terror TERROR_CONFLICT =    {409,"Conflict"};
+ static terror TERROR_USERNAME =    {409,"Username Not Available"};   /* reused code # */
+ 
+ static terror TERROR_INTERNAL =     {500,"Internal Server Error"};
+ static terror TERROR_PASSTOR  =     {500,"Password Storage Failed"}; /* reused code # */
+ static terror TERROR_NOTIMPL  =     {501,"Not Implemented"};
+ static terror TERROR_EXTERNAL =     {502,"Remote Server Error"};
+ static terror TERROR_HOSTRESOLV =   {502,"Unable to resolve hostname."}; /* reused code # */
+ static terror TERROR_UNAVAIL  =     {503,"Service Unavailable"};
+ static terror TERROR_EXTTIMEOUT =   {504,"Remote Server Timeout"};
+ static terror TERROR_DISCONNECTED = {510,"Disconnected"};
+ #endif
  
  /* --------------------------------------------------------- */
  /*                                                           */
Index: jabber-1.4/jabberd/mio.c
diff -c jabber-1.4/jabberd/mio.c:1.1 jabber-1.4/jabberd/mio.c:1.2
*** jabber-1.4/jabberd/mio.c:1.1	Tue Feb 13 13:23:54 2001
--- jabber-1.4/jabberd/mio.c	Mon Feb 26 15:13:16 2001
***************
*** 291,298 ****
          /* we didnt' write it all, move the current buffer up */
          else if(len < cur->len)
          { 
  
!             cur->cur += len;
              cur->len -= len;
              return 1;
          } 
--- 291,300 ----
          /* we didnt' write it all, move the current buffer up */
          else if(len < cur->len)
          { 
+             char *tmpcur;
  
!             tmpcur = (char *)cur->cur + len;
!             cur->cur = (void *)tmpcur;
              cur->len -= len;
              return 1;
          } 
Index: jabber-1.4/jabberd/deliver.c
diff -c jabber-1.4/jabberd/deliver.c:1.1 jabber-1.4/jabberd/deliver.c:1.2
*** jabber-1.4/jabberd/deliver.c:1.1	Tue Feb 13 13:23:54 2001
--- jabber-1.4/jabberd/deliver.c	Mon Feb 26 15:13:22 2001
***************
*** 441,447 ****
  
      /* catch the @-internal xdb crap */
      if(p->type == p_XDB && *(p->host) == '-')
!         return deliver_internal(p, i);
  
      if(deliver__flag == 0)
      { /* postpone delivery till later */
--- 441,450 ----
  
      /* catch the @-internal xdb crap */
      if(p->type == p_XDB && *(p->host) == '-')
!     {
!         deliver_internal(p, i);
!         return;
!     }
  
      if(deliver__flag == 0)
      { /* postpone delivery till later */
***************
*** 565,570 ****
--- 568,574 ----
          h1->next = newh;
          break;
      default:
+ 	break;
      }
  }
  
***************
*** 630,635 ****
--- 634,640 ----
          }
          break;
      default:
+ 	break;
      }
  }
  
Index: jabber-1.4/jabberd/single.h
diff -c jabber-1.4/jabberd/single.h:1.1 jabber-1.4/jabberd/single.h:1.2
*** jabber-1.4/jabberd/single.h:1.1	Tue Feb 13 13:23:54 2001
--- jabber-1.4/jabberd/single.h	Mon Feb 26 15:13:30 2001
***************
*** 3,9 ****
      if(ghash_get(cmd__line,"h") == NULL || (home == NULL && (ghash_get(cmd__line,"s") == NULL || ghash_get(cmd__line,"l") == NULL))) \
      { /* require hostname, and either a HOME or the spool and logs specifically */ \
          fprintf(stderr, "\
! Usage:
   jabberd -h hostname -s /var/spool/jabber -l /var/log/jabber.log &\n\
  Required Parameters:\n\
   -h \t\t A valid hostname that this server is accessible via\n\
--- 3,9 ----
      if(ghash_get(cmd__line,"h") == NULL || (home == NULL && (ghash_get(cmd__line,"s") == NULL || ghash_get(cmd__line,"l") == NULL))) \
      { /* require hostname, and either a HOME or the spool and logs specifically */ \
          fprintf(stderr, "\
! Usage:\
   jabberd -h hostname -s /var/spool/jabber -l /var/log/jabber.log &\n\
  Required Parameters:\n\
   -h \t\t A valid hostname that this server is accessible via\n\
Index: jabber-1.4/jsm/modules/mod_auth_plain.c
diff -c jabber-1.4/jsm/modules/mod_auth_plain.c:1.1 jabber-1.4/jsm/modules/mod_auth_plain.c:1.2
*** jabber-1.4/jsm/modules/mod_auth_plain.c:1.1	Tue Feb 13 13:23:58 2001
--- jabber-1.4/jsm/modules/mod_auth_plain.c	Mon Feb 26 15:13:50 2001
***************
*** 81,87 ****
  
      if(mod_auth_plain_reset(m,m->packet->to,xmlnode_get_tag(m->packet->iq,"password")))
      {
!         jutil_error(m->packet->x,(terror){500,"Password Storage Failed"});
          return M_HANDLED;
      }
  
--- 81,87 ----
  
      if(mod_auth_plain_reset(m,m->packet->to,xmlnode_get_tag(m->packet->iq,"password")))
      {
!         jutil_error(m->packet->x, TERROR_PASSTOR);
          return M_HANDLED;
      }
  
***************
*** 101,107 ****
  
      if(mod_auth_plain_reset(m,m->user->id,pass))
      {
!         js_bounce(m->si,m->packet->x,(terror){500,"Password Storage Failed"});
          return M_HANDLED;
      }
      return M_PASS;
--- 101,107 ----
  
      if(mod_auth_plain_reset(m,m->user->id,pass))
      {
!         js_bounce(m->si,m->packet->x, TERROR_PASSTOR);
          return M_HANDLED;
      }
      return M_PASS;
Index: jabber-1.4/jsm/modules/mod_auth_0k.c
diff -c jabber-1.4/jsm/modules/mod_auth_0k.c:1.1 jabber-1.4/jsm/modules/mod_auth_0k.c:1.2
*** jabber-1.4/jsm/modules/mod_auth_0k.c:1.1	Tue Feb 13 13:23:58 2001
--- jabber-1.4/jsm/modules/mod_auth_0k.c	Mon Feb 26 15:13:59 2001
***************
*** 148,154 ****
  
      if(mod_auth_0k_reset(m,m->packet->to,xmlnode_get_tag(m->packet->iq,"password")))
      {
!         jutil_error(m->packet->x,(terror){500,"Password Storage Failed"});
          return M_HANDLED;
      }
  
--- 148,154 ----
  
      if(mod_auth_0k_reset(m,m->packet->to,xmlnode_get_tag(m->packet->iq,"password")))
      {
!         jutil_error(m->packet->x, TERROR_PASSTOR);
          return M_HANDLED;
      }
  
***************
*** 168,174 ****
  
      if(mod_auth_0k_reset(m,m->user->id,pass))
      {
!         js_bounce(m->si,m->packet->x,(terror){500,"Password Storage Failed"});
          return M_HANDLED;
      }
      return M_PASS;
--- 168,174 ----
  
      if(mod_auth_0k_reset(m,m->user->id,pass))
      {
!         js_bounce(m->si,m->packet->x, TERROR_PASSTOR);
          return M_HANDLED;
      }
      return M_PASS;
Index: jabber-1.4/jsm/modules.c
diff -c jabber-1.4/jsm/modules.c:1.1 jabber-1.4/jsm/modules.c:1.2
*** jabber-1.4/jsm/modules.c:1.1	Tue Feb 13 13:23:58 2001
--- jabber-1.4/jsm/modules.c	Mon Feb 26 15:14:08 2001
***************
*** 157,162 ****
--- 157,163 ----
          case M_HANDLED:
              return 1;
          default:
+ 	    break;
          }
      }
  
Index: jabber-1.4/jsm/authreg.c
diff -c jabber-1.4/jsm/authreg.c:1.1 jabber-1.4/jsm/authreg.c:1.2
*** jabber-1.4/jsm/authreg.c:1.1	Tue Feb 13 13:23:58 2001
--- jabber-1.4/jsm/authreg.c	Mon Feb 26 15:14:18 2001
***************
*** 86,92 ****
              {
                  jutil_error(p->x, TERROR_NOTACCEPTABLE);
              }else if(js_user(si,p->to,NULL) != NULL){
!                 jutil_error(p->x, (terror){409,"Username Not Available"});
              }else if(!js_mapi_call(si, e_REGISTER, p, NULL, NULL)){
                  jutil_error(p->x, TERROR_NOTIMPL);
              }
--- 86,92 ----
              {
                  jutil_error(p->x, TERROR_NOTACCEPTABLE);
              }else if(js_user(si,p->to,NULL) != NULL){
!                 jutil_error(p->x, TERROR_USERNAME);
              }else if(!js_mapi_call(si, e_REGISTER, p, NULL, NULL)){
                  jutil_error(p->x, TERROR_NOTIMPL);
              }
Index: jabber-1.4/dnsrv/dnsrv.c
diff -c jabber-1.4/dnsrv/dnsrv.c:1.1 jabber-1.4/dnsrv/dnsrv.c:1.2
*** jabber-1.4/dnsrv/dnsrv.c:1.1	Tue Feb 13 13:23:59 2001
--- jabber-1.4/dnsrv/dnsrv.c	Mon Feb 26 15:14:28 2001
***************
*** 205,211 ****
  	 xmlnode_put_attrib(pkt, "to", to);
  	 xmlnode_put_attrib(pkt, "ip", ip);
      }else{
! 	 jutil_error(pkt, (terror){502, "Unable to resolve hostname."});
  	 xmlnode_put_attrib(pkt, "iperror", "");
      }
      deliver(dpacket_new(pkt),NULL);
--- 205,211 ----
  	 xmlnode_put_attrib(pkt, "to", to);
  	 xmlnode_put_attrib(pkt, "ip", ip);
      }else{
! 	 jutil_error(pkt, TERROR_HOSTRESOLV);
  	 xmlnode_put_attrib(pkt, "iperror", "");
      }
      deliver(dpacket_new(pkt),NULL);
