Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
richwolski committed Jun 11, 2024
2 parents d6a9474 + 8842fca commit 044d7d2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 23 deletions.
14 changes: 12 additions & 2 deletions apps/self-test/stress-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ void *PutThread(void *arg)
while(PutRemaining > 0) {
PutRemaining--;
gettimeofday(&st->posted,NULL);
//printf("Put: pr: %d\n",PutRemaining);
//printf("Put [%ld]: pr: %d\n",pthread_self(),PutRemaining);
pthread_mutex_unlock(&Plock);
seq_no = WooFPut(Iname,"stress_handler",st);
//printf("Put: seq_no: %ld\n",seq_no);
//printf("Put [%ld]: seq_no: %ld\n",pthread_self(),seq_no);
if(WooFInvalid(seq_no)) {
fprintf(stderr,"put thread failed\n");
fflush(stderr);
Expand Down Expand Up @@ -264,6 +264,16 @@ int main(int argc, char **argv)
pthread_mutex_init(&Glock,NULL);
PutRemaining = size;

#if 0
if(pt > size) {
pt = size;
}

if(gt > size) {
gt = size;
}
#endif

// char Iname[4096];
// unsigned long seq_no;
// MAKE_EXTENDED_NAME(Iname,Wname,"input");
Expand Down
21 changes: 0 additions & 21 deletions src/woofc-mqtt-gateway.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,26 +664,6 @@ printf("WooFProcessPut: called on %s with size %d\n",woof_name,copy_size);
/*
* use msgid to get back specific response
*/
#ifdef FP
memset(sub_string,0,sizeof(sub_string));
sprintf(sub_string,"/usr/bin/mosquitto_sub -c -i %d -q 1 -W %d -C 1 -h %s -t %s.%d -u \'%s\' -P \'%s\'",
msgid,
Timeout,
Broker,
Device_name_space,
msgid,
User_name,
Password);
printf("sub_string: %s\n",sub_string);
fd = popen(sub_string,"r");
if(fd == NULL) {
fprintf(stderr,"WooFProcessPut: open for %s failed\n",sub_string);
free(element);
free(element_string);
seq_no = -1;
goto out;
}
#else
RESP *rs;
rs = MakeRESP(msgid);
if(rs == NULL) {
Expand All @@ -694,7 +674,6 @@ printf("sub_string: %s\n",sub_string);
goto out;
}

#endif
/*
* create the mqtt message to put to the device
*/
Expand Down
2 changes: 2 additions & 0 deletions src/woofc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ WOOF* WooFOpen(const char* name) {

mio = MIOReOpen(local_name);
if (mio == NULL) {
fprintf(stderr, "WooFOpen: reopen woof: %s failed\n", local_name);
fflush(stderr);
return (NULL);
}
DEBUG_LOG("WooFOpen: opened %s\n", local_name);
Expand Down

0 comments on commit 044d7d2

Please sign in to comment.