~ubuntu-branches/ubuntu/breezy/ncbi-tools6/breezy

« back to all changes in this revision

Viewing changes to access/vecscnapi.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2004-06-26 00:18:09 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040626001809-ma39ub7j6dbh8r3t
Tags: 6.1.20040616-1
* New upstream release.
* debian/blast2.docs: adjusted for new arrangement (a separate
  source-tree directory full of HTML files).
* debian/{control,lib*-dbg.install,rules}: switch to new-style -dbg
  packages containing just the stripped-out symbols.
* debian/{installman,ncbi-tools-bin.install,rules}: upstream has dropped
  f(asta)merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
*
30
30
* Version Creation Date:   6/13/00
31
31
*
32
 
* $Revision: 1.6 $
 
32
* $Revision: 1.15 $
33
33
*
34
34
* File Description: 
35
35
*
76
76
)
77
77
 
78
78
{
79
 
  return QUERY_OpenUrlQuery ("ray.nlm.nih.gov", 6224, "/VecScreen/vecscreenQB.cgi",
 
79
  /*
 
80
  return QUERY_OpenUrlQuery ("yar.ncbi.nlm.nih.gov", 6224,
 
81
                             "/VecScreen/vecscreenQB.cgi",
80
82
                             query, "vecscreenapp",
81
83
                             30, eMIME_T_NcbiData, eMIME_Fasta, eENCOD_Url,
82
84
                             fHCC_UrlDecodeInput | fHCC_UrlEncodeOutput);
 
85
  */
 
86
 
 
87
  StringCat (query, "\n");
 
88
  return QUERY_OpenServiceQuery ("VecScreen", query, 30);
83
89
}
84
90
 
85
91
NLM_EXTERN EIO_Status VecScreenWaitForReply (
106
112
#endif
107
113
 
108
114
  starttime = GetSecs ();
109
 
  while ((status = CONN_Wait (conn, eIO_Read, &timeout)) != eIO_Success && max < 300) {
 
115
  while ((status = CONN_Wait (conn, eIO_Read, &timeout)) == eIO_Timeout && max < 300) {
110
116
    currtime = GetSecs ();
111
117
    max = currtime - starttime;
112
118
#ifdef OS_MAC
172
178
              *sttus = '\0';
173
179
              sttus += 9;
174
180
              if (StringCmp (cqp->rid, rid) != 0) {
175
 
                ErrPostEx (SEV_ERROR, 0, 0, "RID mismatch '%s' vs '%s", cqp->rid, rid);
 
181
                ErrPostEx (SEV_ERROR, 0, 0, "RID mismatch '%s' vs '%s'", cqp->rid, rid);
176
182
                cqp->done = TRUE;
177
183
              } else if (StringStr (sttus, "FAILED") != NULL) {
178
184
                cqp->done = TRUE;
 
185
              } else if (StringStr (sttus, "unknown") != NULL) {
 
186
                ErrPostEx (SEV_ERROR, 0, 0, "RID unknown '%s'", rid);
 
187
                cqp->done = TRUE;
179
188
              } else if (StringStr (sttus, "SUCCESS") != NULL) {
180
189
                success = TRUE;
181
190
              } else if (StringStr (sttus, "WAITING") != NULL) {
189
198
        } else if (StringNICmp (line, ">Message", 8) == 0) {
190
199
          str = ReadALine (line, sizeof (line), fp);
191
200
          while (str != NULL && StringNCmp (line, "//", 2) != 0) {
192
 
            /*
193
201
            Message (MSG_POST, "%s\n", str);
194
202
            if (StringStr (line, "FAILURE") != NULL) {
195
203
              if (! waiting) {
196
204
                cqp->done = TRUE;
197
205
              }
198
206
            }
199
 
            */
200
207
            str = ReadALine (line, sizeof (line), fp);
201
208
          }
202
209
        }
279
286
        } else if (StringNICmp (line, ">Message", 8) == 0) {
280
287
          str = ReadALine (line, sizeof (line), fp);
281
288
          while (str != NULL && StringNCmp (line, "//", 2) != 0) {
282
 
            /*
283
289
            Message (MSG_POST, "%s\n", str);
284
290
            if (StringStr (line, "FAILURE") != NULL) {
285
291
              cqp->done = TRUE;
286
292
            }
287
 
            */
288
293
            str = ReadALine (line, sizeof (line), fp);
289
294
          }
290
295
        }
367
372
  CONN  conn;
368
373
  FILE  *fp;
369
374
  Char  path [PATH_MAX];
370
 
  Char  str [64];
 
375
  Char  str [128];
371
376
 
372
377
  if (bsp == NULL || queue == NULL || resultproc == NULL) return FALSE;
373
378
 
437
442
  time_t          currtime;
438
443
  VQueuePtr       next;
439
444
  VQueuePtr PNTR  qptr;
440
 
  Char            str [80];
 
445
  Char            str [128];
441
446
 
442
447
  qptr = (VQueuePtr PNTR) queue;
443
448
  if (qptr == NULL || *qptr == NULL) return 0;
462
467
 
463
468
          /* estimated wait time has expired, so queue another check */
464
469
 
465
 
          if (curr->secondsToWait < 60) {
 
470
          if (curr->secondsToWait < 300) {
466
471
            curr->secondsToWait *= 2;
 
472
            if (curr->secondsToWait > 300) {
 
473
              curr->secondsToWait = 300;
 
474
            }
467
475
          }
468
476
          curr->postedTime = GetSecs ();
469
477