Revision 03256bf1

View differences:

monl/measure_manager.h
336 336

  
337 337
  result monRetrieveResultById(SocketId src, MsgType mt, MeasurementCapabilities flags, MeasurementId mid, enum stat_types st) {
338 338
		struct SocketIdMt h_dst;
339
		MonMeasure *m;
339 340

  
340 341
		h_dst.sid = src;
341
		h_dst.mt = initmeasure->msg_type;
342
		h_dst.mt = mt;
342 343

  
343 344
		/* Check if anything for that destination exists */
344
		if(dispatcherList.find(h_dst) == dispatcherList.end())
345
		if(cDispatcher.dispatcherList.find(h_dst) == cDispatcher.dispatcherList.end()) {
345 346
			return NAN;
347
		}
346 348

  
347 349
		/* check if the specific measure is available */
348
		m = findMeasureFromId(dispatcherList[h_dst], initmeasure->mc, initmeasure->mid);
349
		if(m == NULL)
350
		m = cDispatcher.findMeasureFromId(cDispatcher.dispatcherList[h_dst], flags, mid);
351
		if(m == NULL) {
350 352
			return NAN;
353
		}
351 354

  
352 355
		/* check if the specific measure is storing results */
353
		if(m->rb  == NULL)
356
		if(m->rb  == NULL) {
354 357
			return NAN;
358
		}
355 359

  
356 360
		m->rb->updateStats();
357 361
		return m->rb->stats[st];
358 362
	}
359 363

  
364

  
360 365
	void monParseConfig(void *);
361 366

  
362 367
	int monSetPeerName(const char *pn);
monl/mon_measure.h
210 210
	};
211 211

  
212 212
	void defaultStop() {
213
		if(rb)
214
			rb->publishResults();
215
		stop();
216
		if(param_values[P_DEBUG_FILE] == 1.0 || param_values[P_DEBUG_FILE] == 3.0)
217
			debugStop();
218
	};
213
               if(rb && !(flags & REMOTE))
214
                       rb->publishResults();
215
               stop();
216
               if(param_values[P_DEBUG_FILE] == 1.0 || param_values[P_DEBUG_FILE] == 3.0)
217
                       debugStop();
218
       };
219 219

  
220 220
	/* called when  changes in parameter values happen */
221 221
	virtual int paramChange(MonParameterType ph, MonParameterValue p) {return EOK;};
monl/result_buffer.cpp
217 217
	new_data = true;
218 218

  
219 219
	/* is it time to publish ?*/
220
	if(m->param_values[P_PUBLISHING_PKT_TIME_BASED] == 0.0 && samples % (int)m->param_values[P_PUBLISHING_RATE] == 0) {
221
		return publishResults();
222
	}
220
       if(m->param_values[P_PUBLISHING_PKT_TIME_BASED] == 0.0 && samples % (int)m->param_values[P_PUBLISHING_RATE] == 0 && !(m->flags & REMOTE)) {
221
               return publishResults();
222
       }
223 223

  
224 224
	return EOK;
225 225
};

Also available in: Unified diff