[Samba] patch: better msgs in client.c

John S. Denker jsd at monmouth.com
Sat Feb 22 11:02:17 GMT 2003


Hi --

0) Thanks for providing samba.

1) Attached are some improvements to the error msgs
and debug msgs in client.c.    The patch:
  -- distinguishes between share name and server name
  -- doesn't print scary level-0 msg until _all_
     efforts have failed.
  -- indicates (at level 4) success as well as failure

Cheers -- jsd
-------------- next part --------------
*** orig/client.c	Sat Feb 22 05:22:51 2003
--- new/client.c	Sat Feb 22 05:52:55 2003
***************
*** 2188,2197 ****
  
  	c->protocol = max_protocol;
  
  	if (!cli_session_request(c, &calling, &called)) {
  		char *p;
! 		DEBUG(0,("session request to %s failed (%s)\n", 
! 			 called.name, cli_errstr(c)));
  		cli_shutdown(c);
  		if ((p=strchr(called.name, '.'))) {
  			*p = 0;
--- 2188,2199 ----
  
  	c->protocol = max_protocol;
  
+ 	DEBUG(4,("Trying session request for %s at %s\n", 
+ 		 called.name, server_n));
  	if (!cli_session_request(c, &calling, &called)) {
  		char *p;
! 		DEBUG(4,("session request for %s at %s ungood (%s)\n", 
! 			 called.name, server_n, cli_errstr(c)));
  		cli_shutdown(c);
  		if ((p=strchr(called.name, '.'))) {
  			*p = 0;
***************
*** 2201,2210 ****
  			make_nmb_name(&called , "*SMBSERVER", 0x20);
  			goto again;
  		}
  		return NULL;
  	}
  
! 	DEBUG(4,(" session request ok\n"));
  
  	if (!cli_negprot(c)) {
  		DEBUG(0,("protocol negotiation failed\n"));
--- 2203,2215 ----
  			make_nmb_name(&called , "*SMBSERVER", 0x20);
  			goto again;
  		}
+ 		DEBUG(0,("session request at %s failed (-d 4 for details)\n", 
+ 			 server_n));
  		return NULL;
  	}
  
! 	DEBUG(4,("session request for %s at %s ok\n", 
! 		called.name, server_n));
  
  	if (!cli_negprot(c)) {
  		DEBUG(0,("protocol negotiation failed\n"));


More information about the samba mailing list