- StrBuf *guid;
- AsyncIO *IO = &Cfg->IO;
- int n;
-
-
- SaveMsg = (networker_save_message *) malloc(
- sizeof(networker_save_message));
- memset(SaveMsg, 0, sizeof(networker_save_message));
-
- /* Construct a GUID to use in the S_USETABLE table.
- * If one is not present in the item itself, make one up.
- */
- if (ri->guid != NULL) {
- StrBufSpaceToBlank(ri->guid);
- StrBufTrim(ri->guid);
- guid = NewStrBufPlain(HKEY("rss/"));
- StrBufAppendBuf(guid, ri->guid, 0);
- }
- else {
- MD5Init(&md5context);
- if (ri->title != NULL) {
- MD5Update(&md5context,
- (const unsigned char*)SKEY(ri->title));
- }
- if (ri->link != NULL) {
- MD5Update(&md5context,
- (const unsigned char*)SKEY(ri->link));
- }
- MD5Final(rawdigest, &md5context);
- guid = NewStrBufPlain(NULL,
- MD5_DIGEST_LEN * 2 + 12 /* _rss2ctdl*/);
- StrBufHexEscAppend(guid, NULL, rawdigest, MD5_DIGEST_LEN);
- StrBufAppendBufPlain(guid, HKEY("_rss2ctdl"), 0);
- }
-
- /* translate Item into message. */
- EVM_syslog(LOG_DEBUG, "RSS: translating item...\n");
- if (ri->description == NULL) ri->description = NewStrBufPlain(HKEY(""));
- StrBufSpaceToBlank(ri->description);
- SaveMsg->Msg.cm_magic = CTDLMESSAGE_MAGIC;
- SaveMsg->Msg.cm_anon_type = MES_NORMAL;
- SaveMsg->Msg.cm_format_type = FMT_RFC822;