bool Images::downloadImage ( ) { // error? if ( m_latestIp == 0 || m_latestIp == -1 ) { log(LOG_DEBUG,"images: ip of %s is %li (%s)", m_imageUrl.getUrl(),m_latestIp,mstrerror(g_errno)); // ignore errors g_errno = 0; return true; } CollectionRec *cr = g_collectiondb.getRec(m_collnum); if ( ! cr ) { g_errno = ENOCOLLREC; return true; } // assume success m_httpStatus = 200; // set the request Msg13Request *r = &m_msg13Request; r->reset(); r->m_maxTextDocLen = 200000; r->m_maxOtherDocLen = 500000; r->m_urlIp = m_latestIp; if ( ! strcmp(cr->m_coll,"qatest123")) { r->m_useTestCache = 1; r->m_addToTestCache = 1; } // url is the most important strcpy(r->m_url,m_imageUrl.getUrl()); // . try to download it // . i guess we are ignoring hammers at this point if ( ! m_msg13.getDoc(r,false,this,downloadImageWrapper)) return false; return true; }
bool Images::downloadImage ( ) { // error? if ( m_latestIp == 0 || m_latestIp == -1 ) { log(LOG_DEBUG,"images: ip of %s is %" PRId32" (%s)", m_imageUrl.getUrl(),m_latestIp,mstrerror(g_errno)); // ignore errors g_errno = 0; return true; } CollectionRec *cr = g_collectiondb.getRec(m_collnum); if ( ! cr ) { g_errno = ENOCOLLREC; return true; } // assume success m_httpStatus = 200; // set the request Msg13Request *r = &m_msg13Request; r->reset(); r->m_maxTextDocLen = 200000; r->m_maxOtherDocLen = 500000; r->m_urlIp = m_latestIp; // no, this slows down image stuff too much for now!! so take out // MDW 9/10/14 // if ( ! strcmp(cr->m_coll,"qatest123")) { // r->m_useTestCache = 1; // //if ( g_conf.m_qaBuildMode ) r->m_addToTestCache = 1; // r->m_addToTestCache = 1; // } // url is the most important //strcpy(r->m_url,m_imageUrl.getUrl()); r-> ptr_url = m_imageUrl.getUrl(); r->size_url = m_imageUrl.getUrlLen()+1; // include \0 // . try to download it // . i guess we are ignoring hammers at this point if ( ! m_msg13.getDoc(r,false,this,downloadImageWrapper)) return false; return true; }