git-2.22.0/serve.c
/* Main serve loop for protocol version 2 */
Main serve loop for protocol version 2
Main serve loop for protocol version 2
void serve(struct serve_options *options)
{
	if (options->advertise_capabilities || !options->stateless_rpc) {
		packet_write_fmt(1, "version 2\n");
		advertise_capabilities();
		if (options->advertise_capabilities)
			return;
	}
	if (options->stateless_rpc) {
		process_request();
	} else {
		for (;;)
			if (process_request())
				break;
	}
}
void serve ( struct serve_options * options ) { if ( options -> advertise_capabilities || ! options -> stateless_rpc ) { packet_write_fmt ( 1 , " \n " ) ; advertise_capabilities ( ) ; if ( options -> advertise_capabilities ) return ; } if ( options -> stateless_rpc ) { process_request ( ) ; } else { for ( ; ; ) if ( process_request ( ) ) break ; } }
Main serve loop for protocol version 2
Main serve loop for protocol version 2
/* serve by default supports v2 */ /*
		 * If only the list of capabilities was requested exit
		 * immediately after advertising capabilities
		 */ /*
	 * If stateless-rpc was requested then exit after
	 * a single request/response exchange
	 */