Changeset 27 for trunk/src/sh_forward.c


Ignore:
Timestamp:
Apr 6, 2006, 8:55:51 PM (19 years ago)
Author:
rainer
Message:

Support for server-to-server relay and more user policies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_forward.c

    r22 r27  
    335335#endif
    336336
    337 #ifdef SH_WITH_CLIENT
     337#if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER)
    338338
    339339static int count_dev_server = 0;
     
    708708static long sh_forward_try (char * errmsg);
    709709
     710static unsigned int ServerPort = SH_DEFAULT_PORT;
     711
     712int sh_forward_server_port (const char * str)
     713{
     714  unsigned long l;
     715  char * endptr;
     716
     717  SL_ENTER(_("sh_forward_server_port"));
     718
     719  l = strtoul (str, &endptr, 0);
     720  if (l > 65535 || endptr == str)
     721    {
     722      SL_RETURN (-1, _("sh_forward_server_port"));
     723    }
     724  ServerPort = (unsigned int) l;
     725  SL_RETURN (0, _("sh_forward_server_port"));
     726}
    710727
    711728long sh_forward (char * errmsg)
     
    880897
    881898  sockfd = connect_port_2 (sh.srvexport.name, sh.srvexport.alt,
    882                            SH_DEFAULT_PORT,
     899                           ServerPort,
    883900                           error_call, &error_num, error_msg, 256);
    884901
     
    14411458                                                flag_err,
    14421459                                                MSG_TCP_NOCONF);
    1443                               } else {
     1460                              }
     1461#ifdef SH_WITH_CLIENT
     1462                              else {
    14441463                                sh_socket_server_cmd(buffer);
    14451464                              }
     1465#endif
    14461466                              flag_err = 0;
    14471467
Note: See TracChangeset for help on using the changeset viewer.