/[svn]/liblscp/trunk/src/common.c
ViewVC logotype

Diff of /liblscp/trunk/src/common.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 564 by capela, Sun May 22 22:02:00 2005 UTC revision 623 by capela, Thu Jun 9 10:37:19 2005 UTC
# Line 133  lscp_status_t lscp_client_call ( lscp_cl Line 133  lscp_status_t lscp_client_call ( lscp_cl
133          return ret;          return ret;
134      }      }
135    
136            // Check if last transaction has timed out, in which case
137            // we'll retry wait and flush for some pending garbage...
138            if (pClient->iTimeoutCount > 0) {
139                    cchResult = sizeof(achResult);
140                    ret = lscp_client_recv(pClient, achResult, &cchResult, pClient->iTimeout);
141                    if (ret == LSCP_OK) {
142                            // We've got rid of timeout trouble (hopefully).
143                            pClient->iTimeoutCount = 0;
144                    } else {
145                            // Things are worse than before. Fake a result message.
146                            iErrno = (int) ret;
147                            pszResult = "Failure during flush timeout operation";
148                            lscp_client_set_result(pClient, pszResult, iErrno);
149                            return ret;
150                    }
151            }
152    
153      // Send data, and then, wait for the result...      // Send data, and then, wait for the result...
154      cchQuery = strlen(pszQuery);      cchQuery = strlen(pszQuery);
155      if (send(pClient->cmd.sock, pszQuery, cchQuery, 0) < cchQuery) {      if (send(pClient->cmd.sock, pszQuery, cchQuery, 0) < cchQuery) {
# Line 188  lscp_status_t lscp_client_call ( lscp_cl Line 205  lscp_status_t lscp_client_call ( lscp_cl
205          break;          break;
206    
207        case LSCP_TIMEOUT:        case LSCP_TIMEOUT:
208                    // We have trouble...
209            pClient->iTimeoutCount++;
210          // Fake a result message.          // Fake a result message.
211          pszResult = "Timeout during receive operation";          pszResult = "Timeout during receive operation";
212          iErrno = (int) ret;          iErrno = (int) ret;

Legend:
Removed from v.564  
changed lines
  Added in v.623

  ViewVC Help
Powered by ViewVC