Просмотр исходного кода

[204808] spurious search timeouts
Fixed a problem that ldapsearch reports random timeouts on 64-bit machine.

Noriko Hosoi 19 лет назад
Родитель
Сommit
27ea94caa8

+ 5 - 2
ldap/servers/plugins/chainingdb/cb_search.c

@@ -179,7 +179,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb )
             		slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, NULL );
                 	return 1;
 		}
-		timeout.tv_sec=timelimit-(now-optime);
+		timeout.tv_sec=(time_t)timelimit-(now-optime);
 		timeout.tv_usec=0;
 	}
 
@@ -414,7 +414,10 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb )
 { 
 
 	char 			*target;
-	int			sizelimit,timelimit, rc, parse_rc, optime,i,retcode, attrsonly;
+	int			sizelimit, timelimit;
+	int			rc, parse_rc, retcode;
+	int			i, attrsonly;
+	time_t			optime;
  	LDAPMessage 		*res=NULL;
 	char 			*matched_msg,*error_msg;
 	cb_searchContext 	*ctx=NULL;

+ 1 - 1
ldap/servers/slapd/back-ldif/search.c

@@ -143,7 +143,7 @@ ldif_back_search( Slapi_PBlock *pb )
 
     /*Make sure we're not exceeding our time limit...*/
     currtime = time(&dummy);
-    if ((tlimit > 0) && ((currtime - optime) > tlimit)){
+    if ((tlimit > 0) && ((currtime - optime) > (time_t)tlimit)){
       slapi_send_ldap_result( pb, LDAP_TIMELIMIT_EXCEEDED, NULL, NULL, nentries, NULL);
 
       /*We "hit" the cache*/

+ 1 - 1
ldap/servers/slapd/pblock.c

@@ -348,7 +348,7 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
 		(*(int *)value) = pblock->pb_op->o_params.operation_type;
 		break;
 	case SLAPI_OPINITIATED_TIME:
-		(*(int *)value) = pblock->pb_op->o_time;
+		(*(time_t *)value) = pblock->pb_op->o_time;
 		break;
 	case SLAPI_REQUESTOR_ISROOT:
 		(*(int *)value) = pblock->pb_requestor_isroot;