From 61e5f190a6b3279d466290039d6f6fa246b9aaf3 Mon Sep 17 00:00:00 2001 From: mpc <mpc> Date: Thu, 2 Dec 2004 22:54:22 +0000 Subject: [PATCH] Updated examples --- apps/sam/c/doc/donate.txt | 7 ------- apps/sam/c/doc/todo.txt | 2 +- apps/sam/c/doc/whatsnew.txt | 1 + apps/sam/c/examples/i2p-ping/i2p-ping.c | 6 +++--- apps/sam/c/examples/warhammer/warhammer-dgram.c | 6 +++--- 5 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 apps/sam/c/doc/donate.txt diff --git a/apps/sam/c/doc/donate.txt b/apps/sam/c/doc/donate.txt deleted file mode 100644 index b74604b67e..0000000000 --- a/apps/sam/c/doc/donate.txt +++ /dev/null @@ -1,7 +0,0 @@ -If you would like to make a donation to the author of this library, you can use -the following methods: - - * E-Gold account number 1043280 - * Paypal email mpc@innographx.com - -If you want to use some other method, just ask. diff --git a/apps/sam/c/doc/todo.txt b/apps/sam/c/doc/todo.txt index 8d51040b16..745d326b65 100644 --- a/apps/sam/c/doc/todo.txt +++ b/apps/sam/c/doc/todo.txt @@ -1,6 +1,6 @@ I need to do these things: -* SAM raw support +* SAM raw support (partially complete) * Write an instruction manual * Make dest a dynamic string * Change SAM parser to use a hashmap diff --git a/apps/sam/c/doc/whatsnew.txt b/apps/sam/c/doc/whatsnew.txt index 120d490a13..fbfb131721 100644 --- a/apps/sam/c/doc/whatsnew.txt +++ b/apps/sam/c/doc/whatsnew.txt @@ -1,6 +1,7 @@ /* vi:set ts=4: */ v1.30 + * Removed stdint.h dependency * Improved WIRETAP to do more logging * Added "pinger.sh" shell script example for using i2p-ping * Added SAM_BAD_STYLE error diff --git a/apps/sam/c/examples/i2p-ping/i2p-ping.c b/apps/sam/c/examples/i2p-ping/i2p-ping.c index 09bfb1b5a9..ff68ac0e24 100644 --- a/apps/sam/c/examples/i2p-ping/i2p-ping.c +++ b/apps/sam/c/examples/i2p-ping/i2p-ping.c @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) int count = INT_MAX; /* number of times to ping */ int pongcount = -1; char *samhost = "localhost"; - uint16_t samport = 7656; + unsigned short samport = 7656; while ((ch = getopt(argc, argv, "ac:h:mp:qv")) != -1) { switch (ch) { @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) quiet = true; break; case 'v': /* version */ - puts("$Id: i2p-ping.c,v 1.4 2004/09/22 20:05:40 jrandom Exp $"); + puts("$Id: i2p-ping.c,v 1.5 2004/09/24 16:08:00 mpc Exp $"); puts("Copyright (c) 2004, Matthew P. Cashdollar <mpc@innographx.com>"); break; case '?': @@ -140,7 +140,7 @@ int main(int argc, char *argv[]) pongcount = 0; for (int j = 0; j < argc; j++) { - if (strlen(argv[j]) == 516) { + if (strlen(argv[j]) == SAM_PUBKEY_LEN - 1) { memcpy(dest, argv[j], SAM_PUBKEY_LEN); gotdest = true; } else diff --git a/apps/sam/c/examples/warhammer/warhammer-dgram.c b/apps/sam/c/examples/warhammer/warhammer-dgram.c index 800dbcaaa4..4ebc8729dd 100644 --- a/apps/sam/c/examples/warhammer/warhammer-dgram.c +++ b/apps/sam/c/examples/warhammer/warhammer-dgram.c @@ -88,12 +88,12 @@ int main(int argc, char *argv[]) } /* - * Check whether they've supplied a name or a base 64 destination + * Check whether they've supplied a hostname or a base 64 destination * * Note that this is a hack. Jrandom says that once certificates are added, * the length could be different depending on the certificate's size. */ - if (strlen(argv[1]) == 516) { + if (strlen(argv[1]) == SAM_PUBKEY_LEN - 1) { memcpy(dest, argv[1], SAM_PUBKEY_LEN); gotdest = true; } else { @@ -155,7 +155,7 @@ static void dgramback(sam_sess_t *session, sam_pubkey_t dest, void *data, static void diedback(sam_sess_t *session) { fprintf(stderr, "Lost SAM connection!\n"); - /* high quality code would do a sam_session_free() here */ + sam_session_free(&session); exit(1); } -- GitLab