From: Bodo <bo...@us...> - 2014-04-02 11:17:28
|
Update of /cvsroot/esniper/esniper In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7728 Modified Files: auction.c Log Message: bug#649: only one bug report if tokens not found; minor code improvements Index: auction.c =================================================================== RCS file: /cvsroot/esniper/esniper/auction.c,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** auction.c 2 Apr 2014 11:09:17 -0000 1.125 --- auction.c 2 Apr 2014 11:17:26 -0000 1.126 *************** *** 50,53 **** --- 50,59 ---- #define newRemain(aip) (aip->endTime - time(NULL) - aip->latency - options.bidtime) + #define TOKEN_FOUND_UIID (1 << 0) + #define TOKEN_FOUND_STOK (1 << 1) + #define TOKEN_FOUND_SRT (1 << 2) + + #define TOKEN_FOUND_ALL (TOKEN_FOUND_UIID | TOKEN_FOUND_STOK | TOKEN_FOUND_SRT) + static time_t loginTime = 0; /* Time of last login */ static time_t defaultLoginInterval = 12 * 60 * 60; /* ebay login interval */ *************** *** 289,293 **** char *url; int ret = 0; - int found = 0; if (ebayLogin(aip, 0)) --- 295,298 ---- *************** *** 329,333 **** aip->biduiid = myStrdup(getUntil(mp, '\"')); log(("preBid(): biduiid is \"%s\"", aip->biduiid)); ! found |= 1; break; } --- 334,338 ---- aip->biduiid = myStrdup(getUntil(mp, '\"')); log(("preBid(): biduiid is \"%s\"", aip->biduiid)); ! found |= TOKEN_FOUND_UIID; break; } *************** *** 348,352 **** aip->bidstok = myStrdup(getUntil(mp, '\"')); log(("preBid(): bidstok is \"%s\"", aip->bidstok)); ! found |= 2; break; } --- 353,357 ---- aip->bidstok = myStrdup(getUntil(mp, '\"')); log(("preBid(): bidstok is \"%s\"", aip->bidstok)); ! found |= TOKEN_FOUND_STOK; break; } *************** *** 367,375 **** aip->bidsrt = myStrdup(getUntil(mp, '\"')); log(("preBid(): bidsrt is \"%s\"", aip->bidsrt)); ! found |= 4; break; } ! if ((found & 7) != 7) { pageInfo_t *pageInfo = getPageInfo(mp); --- 372,380 ---- aip->bidsrt = myStrdup(getUntil(mp, '\"')); log(("preBid(): bidsrt is \"%s\"", aip->bidsrt)); ! found |= TOKEN_FOUND_SRT; break; } ! if ((found & TOKEN_FOUND_ALL) != TOKEN_FOUND_ALL) { pageInfo_t *pageInfo = getPageInfo(mp); *************** *** 377,383 **** if (ret < 0) { ret = auctionError(aip, ae_bidtokens, NULL); ! if(!(found & 1)) bugReport("preBid", __FILE__, __LINE__, aip, mp, optiontab, "cannot find bid uiid"); ! if(!(found & 2)) bugReport("preBid", __FILE__, __LINE__, aip, mp, optiontab, "cannot find bid stok"); ! if(!(found & 4)) bugReport("preBid", __FILE__, __LINE__, aip, mp, optiontab, "cannot find bid srt"); } freePageInfo(pageInfo); --- 382,386 ---- if (ret < 0) { ret = auctionError(aip, ae_bidtokens, NULL); ! bugReport("preBid", __FILE__, __LINE__, aip, mp, optiontab, "cannot find bid token (found=%d)", found); } freePageInfo(pageInfo); |