#define PUT_SUBBUF_OK 1
#define PUT_SUBBUF_DIED 0
#define PUT_SUBBUF_PUSHED 2
+#define PUT_SUBBUF_DONE 3
char *sock_path=NULL;
char *trace_path=NULL;
retval = GET_SUBBUF_DONE;
goto end_rep;
}
+ else if(!strcmp(received_msg, "NOTFOUND")) {
+ WARN("For buffer %s, the trace was not found. This likely means it was destroyed by the user.", buf->name);
+ retval = GET_SUBBUF_DONE;
+ goto end_rep;
+ }
else {
DBG("error getting subbuffer %s", buf->name);
retval = -1;
retval = PUT_SUBBUF_DIED;
goto end;
}
- if(result < 0) {
+ else if(result < 0) {
ERR("put_subbuffer: send_message failed");
retval = -1;
goto end;
}
+ else if(result == 0) {
+ /* Program seems finished. However this might not be
+ * the last subbuffer that has to be collected.
+ */
+ retval = PUT_SUBBUF_DIED;
+ goto end;
+ }
result = sscanf(received_msg, "%as", &rep_code);
if(result != 1) {
finish_consuming_dead_subbuffer(buf);
break;
}
+ else if(result == PUT_SUBBUF_DONE) {
+ /* Done with this subbuffer */
+ /* FIXME: add a case where this branch is used? Upon
+ * normal trace termination, at put_subbuf time, a
+ * special last-subbuffer code could be returned by
+ * the listener.
+ */
+ break;
+ }
else if(result == PUT_SUBBUF_OK) {
}
}