Check-in Number:
|
584 | |
Date: |
2001-Aug-01 09:08:31 (local)
2001-Aug-01 07:08:31 (UTC) |
User: | thl |
Branch: | |
Comment: |
reflects removal of sock_sample/sio and addition of sock/nntp |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.6 -> 1.7
--- lmtp2nntp.c 2001/07/26 15:18:57 1.6
+++ lmtp2nntp.c 2001/08/01 07:08:31 1.7
@@ -25,6 +25,8 @@
/* own headers */
#include "lmtp.h"
+#include "nntp.h"
+#include "sock.h"
#ifndef FALSE
#define FALSE (1 != 1)
@@ -118,8 +120,25 @@
lmtp_io_t lmtp_io;
lmtp2nntp_t *ctx;
int i; /* general purpose scratch int, index ... */
+ char *progname;
- char *progname = argv[0];
+ {
+ int s;
+ nntp_t *nntp;
+
+ if ((s = sock_create(argv[1])) == -1) {
+ fprintf(stderr, "fuck socket\n");
+ exit(1);
+ }
+ nntp = nntp_create(s, s, NULL);
+ nntp_post(nntp, "...");
+ nntp_destroy(nntp);
+ sock_destroy(s);
+ exit(0);
+
+ }
+
+ progname = argv[0];
/* create application context */
if ((ctx = (lmtp2nntp_t *)malloc(sizeof(lmtp2nntp_t))) == NULL)
@@ -238,7 +257,6 @@
lmtp_res_t res;
char errorstring[STDSTRLEN];
char *cp;
- int FIXME;
cp = NULL;
if (ctx->lhlo_seen == TRUE) {
@@ -270,6 +288,16 @@
# <element> ::= <name> | "#" <number> | "[" <dotnum> "]"
# <domain> ::= <element> | <element> "." <domain>
+ FIXME # BNF grammar for <domain> according to RFC1035:
+ # <letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case
+ # <digit> ::= any one of the ten digits 0 through 9
+ # <let-dig> ::= <letter> | <digit>
+ # <let-dig-hyp> ::= <let-dig> | "-"
+ # <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
+ # <label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
+ # <subdomain> ::= <label> | <subdomain> "." <label>
+ # <domain> ::= <subdomain> | " "
+
# corresponding Perl regular expression ($domain)
$snum = "(?:[0-9]|[0-9]{2}|[0-1][0-9]{2}|2[0-4][0-9]|25[0-5])";
$d = "[0-9]";
|
|