When nothing was received in a read attempt, we need not adjust the
buffered data's read position nor the glib string object's size. Skip
any processing for empty input, just keep checking for timeouts.
return SR_ERR;
} else if (len > 0) {
laststart = g_get_monotonic_time();
+ offset += len;
+ g_string_set_size(response, offset);
}
- offset += len;
- g_string_set_size(response, offset);
elapsed_ms = (g_get_monotonic_time() - laststart) / 1000;
if (elapsed_ms >= scpi->read_timeout_ms) {
sr_err("Timed out waiting for SCPI response.");