Skip to content
Snippets Groups Projects
Commit 0cd39edc authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

api: fix timeout issue

Long-term, once the TX buffering is fixed, this will not be a problem.
In the meantime, it still needs to work. This re-hack fixes the hack.
parent b0bb9839
No related merge requests found
......@@ -65,8 +65,18 @@ long eb_socket_run(eb_socket_t socketp, long timeout_us) {
long eb_deadline;
long eb_timeout_us;
/* Find all descriptors */
FD_ZERO(&sets.rfds);
FD_ZERO(&sets.wfds);
sets.nfd = 0;
/* Determine the deadline */
gettimeofday(&start, 0);
/* !!! hack starts: until we fix sender flow control */
eb_socket_check(socketp, start.tv_sec, &sets, &eb_check_sets);
/* !!! hack ends */
eb_deadline = eb_socket_timeout(socketp);
if (timeout_us == -1)
......@@ -84,15 +94,6 @@ long eb_socket_run(eb_socket_t socketp, long timeout_us) {
timeout.tv_sec = timeout_us / 1000000;
timeout.tv_usec = timeout_us % 1000000;
/* Find all descriptors */
FD_ZERO(&sets.rfds);
FD_ZERO(&sets.wfds);
sets.nfd = 0;
/* !!! hack starts: until we fix sender flow control */
eb_socket_check(socketp, start.tv_sec, &sets, &eb_check_sets);
/* !!! hack ends */
eb_socket_descriptors(socketp, &sets, &eb_update_sets);
select(sets.nfd+1, &sets.rfds, &sets.wfds, 0, &timeout);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment