version 2.49, 1996/01/31 22:40:27
|
version 2.50, 1996/02/09 19:26:37
|
Line 218 PRIVATE int HTNewsStatus_free (HTStream
|
Line 218 PRIVATE int HTNewsStatus_free (HTStream
|
if ((status = (*me->target->isa->_free)(me->target)) == HT_WOULD_BLOCK) |
if ((status = (*me->target->isa->_free)(me->target)) == HT_WOULD_BLOCK) |
return HT_WOULD_BLOCK; |
return HT_WOULD_BLOCK; |
} |
} |
free(me); |
HT_FREE(me); |
return status; |
return status; |
} |
} |
|
|
Line 226 PRIVATE int HTNewsStatus_abort (HTStream
|
Line 226 PRIVATE int HTNewsStatus_abort (HTStream
|
{ |
{ |
if (me->target) |
if (me->target) |
ABORT_TARGET; |
ABORT_TARGET; |
free(me); |
HT_FREE(me); |
if (PROT_TRACE) TTYPrint(TDEST, "NewsStatus.. ABORTING...\n"); |
if (PROT_TRACE) TTYPrint(TDEST, "NewsStatus.. ABORTING...\n"); |
return HT_ERROR; |
return HT_ERROR; |
} |
} |
Line 244 PRIVATE CONST HTStreamClass HTNewsStatus
|
Line 244 PRIVATE CONST HTStreamClass HTNewsStatus
|
|
|
PUBLIC HTStream *HTNewsStatus_new (HTRequest * request, news_info * news) |
PUBLIC HTStream *HTNewsStatus_new (HTRequest * request, news_info * news) |
{ |
{ |
HTStream *me = (HTStream *) calloc(1, sizeof(HTStream)); |
HTStream *me; |
if (!me) outofmem(__FILE__, "HTNewsStatus_new"); |
if ((me = (HTStream *) HT_CALLOC(1, sizeof(HTStream))) == NULL) |
|
HT_OUTOFMEM("HTNewsStatus_new"); |
me->isa = &HTNewsStatusClass; |
me->isa = &HTNewsStatusClass; |
me->request = request; |
me->request = request; |
me->news = news; |
me->news = news; |
Line 381 PUBLIC CONST char *HTNews_host (void)
|
Line 382 PUBLIC CONST char *HTNews_host (void)
|
*/ |
*/ |
PUBLIC void HTFreeNewsHost (void) |
PUBLIC void HTFreeNewsHost (void) |
{ |
{ |
FREE(HTNewsHost); |
HT_FREE(HTNewsHost); |
} |
} |
|
|
/* HTNewsCleanup |
/* HTNewsCleanup |
Line 405 PRIVATE int HTNewsCleanup (HTRequest * r
|
Line 406 PRIVATE int HTNewsCleanup (HTRequest * r
|
/* Remove the request object and our own context structure for nntp */ |
/* Remove the request object and our own context structure for nntp */ |
HTNet_delete(net, status); |
HTNet_delete(net, status); |
if (news) { |
if (news) { |
FREE(news->name); |
HT_FREE(news->name); |
HTChunk_delete(news->cmd); |
HTChunk_delete(news->cmd); |
FREE(news); |
HT_FREE(news); |
} |
} |
return YES; |
return YES; |
} |
} |
Line 457 PUBLIC int HTLoadNews (SOCKET soc, HTReq
|
Line 458 PUBLIC int HTLoadNews (SOCKET soc, HTReq
|
if (ops == FD_NONE) { |
if (ops == FD_NONE) { |
if (PROT_TRACE) |
if (PROT_TRACE) |
TTYPrint(TDEST, "NNTP........ Looking for `%s\'\n", url); |
TTYPrint(TDEST, "NNTP........ Looking for `%s\'\n", url); |
if ((news = (news_info *) calloc(1, sizeof(news_info))) == NULL) |
if ((news = (news_info *) HT_CALLOC(1, sizeof(news_info))) == NULL) |
outofmem(__FILE__, "HTLoadNews"); |
HT_OUTOFMEM("HTLoadNews"); |
news->cmd = HTChunk_new(128); |
news->cmd = HTChunk_new(128); |
news->state = NEWS_BEGIN; |
news->state = NEWS_BEGIN; |
net->context = news; |
net->context = news; |
Line 492 PUBLIC int HTLoadNews (SOCKET soc, HTReq
|
Line 493 PUBLIC int HTLoadNews (SOCKET soc, HTReq
|
StrAllocCopy(newshack, "news://"); |
StrAllocCopy(newshack, "news://"); |
StrAllocCat(newshack, newshost); |
StrAllocCat(newshack, newshost); |
status = HTDoConnect(net, (char *) newshack, NEWS_PORT); |
status = HTDoConnect(net, (char *) newshack, NEWS_PORT); |
free(newshack); |
HT_FREE(newshack); |
} else |
} else |
news->state = NEWS_ERROR; |
news->state = NEWS_ERROR; |
} else if (!strncasecomp(url, "nntp:", 5)) { |
} else if (!strncasecomp(url, "nntp:", 5)) { |
Line 568 PUBLIC int HTLoadNews (SOCKET soc, HTReq
|
Line 569 PUBLIC int HTLoadNews (SOCKET soc, HTReq
|
if (request->method == METHOD_GET) { |
if (request->method == METHOD_GET) { |
if (strchr(url, '@')) { /* ARTICLE */ |
if (strchr(url, '@')) { /* ARTICLE */ |
if (*(news->name) != '<') { /* Add '<' and '>' */ |
if (*(news->name) != '<') { /* Add '<' and '>' */ |
char *newart = (char *) malloc(strlen(news->name)+3); |
char *newart; |
if (!newart) outofmem(__FILE__, "HTLoadNews"); |
if ((newart = (char *) HT_MALLOC(strlen(news->name)+3)) == NULL) |
|
HT_OUTOFMEM("HTLoadNews"); |
sprintf(newart, "<%s>", news->name); |
sprintf(newart, "<%s>", news->name); |
free(news->name); |
HT_FREE(news->name); |
news->name = newart; |
news->name = newart; |
} |
} |
news->state = NEWS_NEED_ARTICLE; |
news->state = NEWS_NEED_ARTICLE; |