Example #1
0
        /// <exception cref="System.IO.IOException"></exception>
        /// <exception cref="NGit.Transport.Resolver.ServiceNotEnabledException"></exception>
        /// <exception cref="NGit.Transport.Resolver.ServiceNotAuthorizedException"></exception>
        internal virtual void Execute(Socket sock)
        {
            rawIn  = new BufferedInputStream(sock.GetInputStream());
            rawOut = new SafeBufferedOutputStream(sock.GetOutputStream());
            if (0 < daemon.GetTimeout())
            {
                sock.ReceiveTimeout = daemon.GetTimeout() * 1000;
            }
            string cmd = new PacketLineIn(rawIn).ReadStringRaw();
            int    nul = cmd.IndexOf('\0');

            if (nul >= 0)
            {
                // Newer clients hide a "host" header behind this byte.
                // Currently we don't use it for anything, so we ignore
                // this portion of the command.
                //
                cmd = Sharpen.Runtime.Substring(cmd, 0, nul);
            }
            DaemonService srv = GetDaemon().MatchService(cmd);

            if (srv == null)
            {
                return;
            }
            sock.ReceiveTimeout = 0;
            srv.Execute(this, cmd);
        }
Example #2
0
 internal ServiceConfig(DaemonService service, Config cfg, string name)
 {
     enabled = cfg.GetBoolean("daemon", name, service.IsEnabled());
 }
Example #3
0
 public _SectionParser_67(DaemonService _enclosing, string cfgName)
 {
     this._enclosing = _enclosing;
     this.cfgName    = cfgName;
 }